DLL 파일 생성 시.
소스를 DLL파일로 변환하기 위해 만들고 있는데 C++ 에서 사용 되었던 CFile 클래스가 선언이 되지 않았다는 오류를 보고 afx.h를 인클루드 시켜 줬더니 다음과 같은 에러가 떴다.
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
windows.h 파일은 이미 인클루드 되어 있다고..?
확인해보니 stdafx.h파일에 windows.h파일이 이미 인클루드 되어있다..
하지만 내가 인클루드 시켜준 것은 afx.h파일인데.. 그렇다면 afx.h파일하고 windows.h파일이 연관이 있다는건데..
stdafx.h파일을 보니
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// TODO: reference additional headers your program requires here
다음과 같이 있더라..
windows.h아래에 afx.h파일을 넣어줬는데 위으 오류가 나서 반대로 위쪽으로 움직여줬더니 저상적으로 동작함.