解决错误 fatal error C1010: unexpected end of file while looking for precompiled head

在编译VS时候,出现fatal error C1010: unexpected end of file while looking for precompiled head。


问题详细解释:致命错误C1010,在寻找预编译指示头文件时,文件未预期结束。就是没有找到预编译指示信息的问文件。

顾名思义就是预编译因为缺少了预编译文件而失败。解决方法显然可以取消预编译,或者帮助编译器找到预编译文件。

故解法:

1.右键单击项目工程中的cpp文件,在菜单Project->Settings->C/C++->Precompile Header,设置为第一项:Not using precompile headers。

2.在.cpp文件开头添加包含文件stdafx.h。 #include"stdafx.h"


~~~~~~~~~~~请叫我雷锋~~~~~~~~~


你可能感兴趣的:(工作)