unexpected end of file while looking for precompiled header directive 是什么错误啊?

来源:百度知道 编辑:UC知道 时间:2024/07/02 06:21:20
文件头部添加了#include "stdafx.h"语句还不行啊

错误:unexpected end of file while looking for precompiled headerdirective
分析:工程头文件处理的错误。
解决办法如下:
1、右键点工程名,选设置,然后选c/c++属性页,再选catagory选单中选 precompiled header ,将选项置成no use 或者autometic
2、如果使用的是Win32工程,可能就是错误文件没有包含:#include "stdafx.h" ,添加该包含即可。

如何解决:"fatal error C1010:VC++6.0中常出现的"unexpected end of file while looking for precompiled header directive"的问题?
我想大家在VC6.0中经常回遇到这样的问题,如何解决呢?
1、看看是否缺少“;”,“}”
隐藏得深的是宏、.h文件的问题就要费点心思了
2、一定是你在类的部分定义被删除了,M$在每个类中定义一些特殊的常量,是成对的,如下:
.h:
#if !defined(AFX_CHILDFRM_H__54CA89DD_BA94_11D4_94D7_0010B503C2EA__INCLUDED_)
#define AFX_CHILDFRM_H__54CA89DD_BA94_11D4_94D7_0010B503C2EA__INCLUDED_
.......
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MAINFRM_H__54CA89DB_BA94_11D4_94D7_00