unexpected end of file while looking for precompiled header directive 经常遇到这种情况,我发现只要在每个cpp文件开头都加上#include "stdafx.h",就行了。但有时候对一些作为库使用的cpp文件最好还是不要加这些东西,请问还有什么其他的解决办法么?最好也能仔细讲一下其中的原理,谢谢了先。
unexpected end of file while looking for precompiled header directive 经常遇到这种情况,我发现只要在每个cpp文件开头都加上#include "stdafx.h",就行了。但有时候对一些作为库使用的cpp文件最好还是不要加这些东西,请问还有什么其他的解决办法么?最好也能仔细讲一下其中的原理,谢谢了先。
not using procompliled headers
或如一楼所说不用 procompliled headers
not using procompliled headers,比较好
加#include "stdafx.h"有时没有用
我的代码是:
#include <afxwin.h>
#include "Hello.h"CMyApp myApp;
...
如果写成
#include "stdafx.h"
#include <afxwin.h>
#include "Hello.h"CMyApp myApp;
...
编译没有任何错误,如果写成这样:
#include <afxwin.h>
#include "Hello.h"
#include "stdafx.h"CMyApp myApp;
...
就有三个错:
1.error C2146: syntax error : missing ';' before identifier 'myApp';
2.error C2501: 'CMyApp' : missing storage-class or type specifiers;
3.fatal error C1004: unexpected end of file found;
这又是怎么一回事呢?
我初学MFC,还请多多指教!