`

VC++6.0中常出现的"unexpected end of file while looking for precompiled header directi

    博客分类:
  • C++
阅读更多

VC++6.0中常出现的"unexpected end of file while looking for precompiled header directive"的问题?

转自:http://blog.163.com/yujishui2887090@126/blog/static/2179252020072161076844/

如何解决:"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]

 

我在编程时遇到了第3个错误(红色标注提醒自己)。

分享到:
评论

相关推荐

    解决fatal error C1010 unexpected end of file while looking for precompiled header

    在编程过程中,尤其是在使用Microsoft Visual Studio (VC) 进行C++开发时,可能会遇到一个编译错误:“fatal error C1010: unexpected end of file while looking for precompiled header directive”。这个错误通常...

    C语言常见错误.txt

    当宏定义中出现了未定义的标识符,并且该标识符没有作为宏的参数时,会出现此错误。 **解决方法:** - 确保所有宏中的标识符都是有效的参数。 - 检查宏定义是否存在语法错误。 #### 6. Ambiguous symbol xxxxxxxx ...

    VC++6.0编译及链接时常见问题的解决及_pragma.txt

    #### 错误C1010: unexpected end of file while looking for precompiled header directive **错误描述**: 编译器在寻找预编译头文件指令时意外地到达了文件末尾。 **解决方法**: 1. 确保项目包含`stdafx.h`头文件...

    VC开发程序经验, 详细介绍了在实际开发中的经验

    1.unexpected end of file while looking for precompiled header directive 原因不清楚,一般工程不会出现此问题,这次出现此问题主要是我用了于士其写的关于免装dxshow所写的类CameraDS所导致(解决此问题是一个...

    VC++6.0常见错误提示

    #### 二、fatal error C1004: unexpected end of file found - **中文对照**:(编译错误)文件未结束 - **分析**:这类错误通常出现在以下几种情况: - 缺少闭合的花括号`}`。 - 括号不匹配,如函数调用或表达式...

    VC程序\vc++6.0编译出错

    #### 三、fatal error C1004: unexpected end of file found **问题描述**: 此错误提示通常是由于源文件中的花括号不匹配导致的。 **解决方法**: 1. **检查括号配对**:确保所有 `{` 都有对应的 `}`。 2. **使用...

    最常见的20种VC++错误

    在VC++编程中,开发者经常会遇到各种编译和链接错误,这些错误往往导致程序无法正常构建。以下是对最常见的20种VC++错误的详细解释和解决建议: 1. **fatal error C1010**: 当编译器在查找预编译头文件(如 stdafx....

    CentOS7运行.sh脚本提示syntax error: unexpected end of file的解决方法

    CentOS 7运行.sh脚本提示syntax error: unexpected end of file。脚本是通过本地电脑的notepad++编辑之后用ftp上传到CentOS 7服务器上的。 错误原因: shell脚本在本地电脑编辑的,格式是dos(可以用vi编辑该shell...

    unexpected end of file(解决方案).md

    unexpected end of file(解决方案).md

    VC++常见错误提示

    1. fatal error C1010: unexpected end of file while looking for precompiled header directive 这是一种致命错误,发生在编译器查找预编译头文件时遇到了文件尾,通常是因为缺少#include "stdafx.h"语句。解决...

    PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法

    首先,错误提示中的“unexpected end of file”是指解析器在期望看到更多的代码或语句结束标记时,却在文件末尾遇到了结束。这可能由于以下几种情况: 1. **PHP语句没有正确关闭**:在PHP中,代码块必须以分号`;`...

    vc提示unexpected end of file found的原因分析

    在编程过程中,尤其是在使用Visual C++ (vc) 进行开发时,可能会遇到一个常见的编译错误:“unexpected end of file found”。这个错误通常意味着编译器在预期找到文件结束标记时,没有找到相应的配对符号,导致解析...

    beego 部署时出现Error:unexpected end of JSON input

    GO beego 部署时出现Error:unexpected end of JSON input 文章目录GO beego 部署时出现Error:unexpected end of JSON input1、Note2、解决方法原理实现3、参考 beego Error: unexpected end of JSON input 1、Note...

    MATLAB与VC之浅析.pdf

    - 同时,还提到了一些问题处理,例如编译错误(如:fatal error C1010: unexpected end of file while looking for precompiled header directive)的解决方法,以及在VC++工程中配置相应的.dll和.lib文件。...

    visual Studio2008C++ expression使用文档

    在某些情况下,如果不改变预编译头文件设置,编译时可能会遇到错误:“fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your ...

    最常见的20种VC++编错误信息.doc

    fatal error C1010: unexpected end of file while looking for precompiled header directive 当VC++在寻找预编译头文件路径时遇到了文件结束标志,即表示在源代码中预编译头文件的包含指令(`#include "stdafx.h"`...

Global site tag (gtag.js) - Google Analytics