我自己编了个编函数,想把它放在一个cpp中,我通过“工程——添加工程——新建...”方法加入了一个.h和.cpp文件。但编绎的时候,出现以下错误:
d:\sh\rdsk\my.cpp(6) : fatal error C1010: unexpected end of file while looking for precompiled header directive谁能帮我解决一下,100分想送!!!
d:\sh\rdsk\my.cpp(6) : fatal error C1010: unexpected end of file while looking for precompiled header directive谁能帮我解决一下,100分想送!!!
#ifndefine _my_h
#define _my_h....
//your file#endif
这就可以了
unexpected end of file while looking for precompiled header directiveA precompiled header was specified, but it did not contain a precompiled header directive.This error can be caused by specifying an incorrect file as a header file, or by specifying an include file with the /Yu (Use Precompiled Header) command line option that is not listed in the source file as an include file.
如果代码是从网页上copy后在*.cpp, *.h文件中粘贴的话,很可能会出现VC不能识别的字符,如|、:、;等,这符号的不同很难看得出,最好是自己重新再敲一次键盘,注意不要打开输入法
加入 #include "stdafx.h"
是因为你在编译的时候选择了预编译头文件.
可以在project->setting->c++ : category中选择Precomplid headers
然后选择是否设置预编译头文件.