针对VC++中一种常出现的错误的几种解决方法
2009-05-16 09:03
429 查看
如何解决:"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_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]
我想大家在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_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]
相关文章推荐
- JetBrains PyCharm输出中文出现错误or乱码的几种解决方法
- 浅谈Tensorflow由于版本问题出现的几种错误及解决方法
- VC++编译代码出现LNK2005错误的一种情况的解决
- win8 安装VC++ 6.0 出现错误的解决方法
- 关于swift中出现 use of undeclared type ***错误的一种解决方法
- linux/ubuntu下安装nginx时./configure后出现几种错误的解决方法
- Android N加载系统私有库时出现is not accessible for the namespace错误和针对该错误的解决方法
- win8 安装VC++ 6.0 出现错误的解决方法
- 编译boost程序出现如下错误fatal error LNK1104: cannot open file 'libboost_system-vc100-mt-gd-1_54.lib'的解决方法
- 编译boost程序出现如下错误fatal error LNK1104: cannot open file 'libboost_system-vc100-mt-gd-1_54.lib'的解决方法
- SVN出现错误“error running context: an error occurred during ssl communication”的一种可能的解决方法
- SQL安装时出错,提示:安装程序配置服务器失败 参考服务器错误日志。针对其中一种情况的解决方法!
- VC++ 出现错误:cannot convert from const char *' to 'LPCWSTR' 或者'const char [7]' to 'LPCWSTR' 的解决方法
- 解决Oracle中用EXP 命令后用IMP导出数据出现错误的一种方法
- 对称加密 出现错误 填充无效,无法被移除 一种解决方法
- vc 6.0 MFC 出现unknown character '0xa1' 错误的解决方法
- 使用dojo框架出现错误"SyntaxError: Unexpected token <"中的一种解决方法
- 编译boost程序出现如下错误fatal error LNK1104: cannot open file 'libboost_system-vc100-mt-gd-1_54.lib'的解决方法
- 编译boost程序出现如下错误fatal error LNK1104: cannot open file 'libboost_system-vc100-mt-gd-1_54.lib'的解决方法
- VC++ 2005编译出程序出现“应用程序配置错误”的解决方法