最新消息:本站技术交流 QQ 群:28124927

编译错误 fatal error C1010: unexpected end of file while looking for precompiled header directive

Windows 应用编程/MFC exchen 4864浏览 0评论

VC6.0在编译的时候出现这种错误

fatal error C1010: unexpected end of file while looking for precompiled header directive

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

问题一般发生在:
通过添加文件的方式,添加了一些cpp文件到一个MFC的程序,但该cpp文件并不是MFC,是标准C++的。

解决方案1:
右键点击项目工程中的该cpp文件,在菜单Project 》Settings里C++页面的Precomplie Header,设置为第一项:Not using precompiled headers。

解决方案2:
在.cpp文件开头添加包含文件stdafx.h。

#include "stdafx.h"

转载请注明:exchen's blog » 编译错误 fatal error C1010: unexpected end of file while looking for precompiled header directive

发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址