请教:关于stdafx.h头文件出现的一个问题
我有一个文件是多个程序的公用文件,而另外不是MFC的程序不需要包含stdafx.h头文件.于是我先在我的MFC工程中,预处理器中加入一个宏_MFC_,然后我在.cpp中写:
#ifdef _MFC_
#include "stdafx.h"
#endif
结果老是报:
fatal error C1020: 意外的 #endif
这个很诡异,如果我去掉#include "stdafx.h",则不会有这个错误
#ifdef _MFC_
//#include "stdafx.h"
#endif
成了
fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h"”
难道是stdafx.h中的#if #endif 没有配好对么?