unexpected end of file while looking for precompiled headerdirective Add directive to 'stdafx.h' or rebuild precompiled header错误
解决方式:
项目工程右键->propertity(属性),选择不用于预编译头

原因:
C++的编译过程如下:

当头文件很多时,预编译过程需要耗费大量时间,为了减少重复编译的次数,C和C++提供了预编译任何 C 或 C++ 代码方式,将stdafx.h(预编译头)内的文件,以已编译状态的代码存储在文件中,以及在随后的编译中,将预编译的代码与仍在开发的代码结合起来,提高编译速度。
预编译头文件通过编译stdafx.cpp生成,以工程名命名,由于预编译的头文件的后缀是“pch”,所以编译结果文件是projectname.pch。
编译器通过一个头文件stdafx.h来使用预编译头文件。stdafx.h这个头文件名是可以在project的编译设置里指定的。编译器认为,所有在指令#include "stdafx.h"前的代码都是预编译的,它跳过#include "stdafx. h"指令,使用projectname.pch编译这条指令之后的所有代码。
因此,所有的CPP实现文件第一条语句都是:#include "stdafx.h"。
报错问题也是与此有关

unexpected end of file while looking for precompiled headerdirective Add directive to 'stdafx.h' or rebuild precompiled header错误的更多相关文章
- 解决错误 fatal error C1010: unexpected end of file while looking for precompiled head
在编译VS时候,出现fatal error C1010: unexpected end of file while looking for precompiled head. 问题详解:致命错误C10 ...
- fatal error C1010: unexpected end of file while looking for precompiled header directive
在编译VS时候,出现fatal error C1010: unexpected end of file while looking for precompiled head. 问题详细解释:致命错误C ...
- 【Visual Studio】解决错误 fatal error C1010: unexpected end of file while looking for precompiled head(转)
原文转自 http://blog.csdn.net/liuqiyao_01/article/details/38867145 在编译VS时候,出现fatal error C1010: unexpect ...
- Unexpected end of file from server 服务器访问问题导致
Caused by: java.net.SocketException: SocketException invoking http://xxxx/cxf/xh/creditInterface?wsd ...
- SHELL syntax error:unexpected end of file 提示错误
SHELL syntax error:unexpected end of file 提示错误 if [ -n "$1" ] then " else " fi e ...
- linux经常使用(一)linux 安装配置 jdk之 找不到安装文件文件夹及source /etc/profile 报unexpected end of file 错误 解决
linux 安装配置 jdk 应该算是一个非常主要的东西.可是我到如今才自己第一次 正式安装.果然出现了问题.. 问题就是 安装之后 找不到 安装路径 ,进而没法配置环境变量. 现象例如以下: 提示 ...
- 【问题解决】syntax error: unexpected end of file或-bash: ./full_build.sh: /bin/bash^M: bad interpreter: No
在阅读的过程中有不论什么问题,欢迎一起交流 邮箱:1494713801@qq.com QQ:1494713801 运行一个脚本full_build.sh 时, 一直是提示我: -bash: ./ ...
- Exception: Unexpected End Of File(crontab)
Exception: Unexpected End Of File [solphire@hadoop02 tools]$ crontab -l 1 * * * * source /etc/profil ...
- freemarker.core.ParseException:Unexpected end of file reached
1.错误原因 freemarker.core.ParseException:Unexpected end of file reached 2.错误原因 由于在宏定义中,运用组件时没有关闭标签,导致出错 ...
随机推荐
- Nodejs中的JavaScript
一.Ecmascript ①基本语法:if var function Object Array等 ②特别注意:Node.js中没有DOM和BOM 二.核心模块: 1.Node.js为JavaScrip ...
- “知乎杯”2018 CCF 大学生计算机系统与程序设计竞赛 贪心算法(greedy)
--> 贪心算法 1)题解 • 分别用V0.V1和V>=2表示度为0.1以及至少为2的顶点集合 • 对于每个顶点,维护三个属性: • degree ...
- 【JZOJ6227】【20190621】ichi
题目 $n , m ,d,x\le 10^5 , $强制在线 题解 对原树做dfs,得到原树的dfs序 对kruksal重构树做dfs,得到重构树的dfs序 那么就是一个三维数点问题 强制在线并且卡空 ...
- 【loj2262】【CTSC2017】网络
题目 一颗\(n\)个点的树,求加入一条边点之后两点间最长距离的最小值 : \(n \le 100000\) ; 题解 首先加入边的两个端点一定在直径上面,先\(dfs\)拎出直径来讨论(下标只代表直 ...
- 洛谷P1081 开车旅行
题目 双向链表+倍增+模拟. \(70pts\): 说白了此题的暴力就是细节较多的模拟题. 我们设离\(i\)城市最近的点的位置为\(B[i]\),第二近的位置为\(A[i]\).设\(A\)或\(B ...
- BMP文件格式详解(BMP file format)
BMP文件格式,又称为Bitmap(位图),或是DIB(Device-Independent Device,设备无关图),是windows系统中广泛使用的图片文件格式,由于它可以不作任何变换地址保存图 ...
- Error:gradle-resources-test:thymeleaf-in-action.main: java.lang.NoClassDefFoundError: org/apache/tools/ant/util/ReaderInputStream
目录 Error:gradle-resources-test:thymeleaf-in-action.main: java.lang.NoClassDefFoundError: org/apache/ ...
- Pandas使用实用技巧
Pandas实用使用技巧 1 列拆分成行 常见的需求是将某一列根据指定的分隔符拆分成多列.现有需求,根据指定的分隔符将其拆分为多行. 例: df = A B 0 a f 1 b;c h;g 2 d k ...
- IDEA中设置自动build-改动代码,不用重启工程,刷新页面即可
1.CTRL + SHIFT + A --> 查找Registry --> 找到并勾选compiler.automake.allow.when.app.running 2. FILE ...
- 子查询优化 - Hyper
Unnesting Arbitrary Queries - T Neumann, A KemperThe Complete Story of Joins (in HyPer) - Thomas Neu ...