VC++6.0中"unexpected end of file while looking for precompiled header directive"的解决方法

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_0010B503C2EA__INCLUDED_)
你可以新建一个类,然后把这些拷贝过去或补上就可以了。
   
3、在头部加入 #include "stdafx.h"

4、在CPP文件第一行加上#include "stdafx.h"。
或者Rebuild All.  

5、

(1). [Project] - [Settings] - [C/C++] - [Category]
(2). 选择 [Precomplied Headers]
(3). 单选 [Not Using Precomplied Headers]
(4). [OK]

你可能感兴趣的:(VC++6.0中"unexpected end of file while looking for precompiled header directive"的解决方法)