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.错误原因 由于在宏定义中,运用组件时没有关闭标签,导致出错 ...
随机推荐
- jupyter Notebook 设置密码
由于服务器关闭了图形界面 所以在服务器上安装Jupyter Notebook 随后本机web访问,利用本机的显卡可以执行plt相关图形命令 本次介绍如何设置Jupyter Notebook的密码设定 ...
- 详解如何在CentOS7中使用Nginx和PHP7-FPM安装Nextcloud
转载地址:https://www.jb51.net/article/109382.htm 这篇文章主要介绍了详解如何在CentOS7中使用Nginx和PHP7-FPM安装Nextcloud,会通过 N ...
- hibernate工具类
因为hibernate的代码大部分都是固定的,为了将减少重复的代码的书写,可以将这些代码封装为一个工具类,获取hibernate的session对象. 1.工具类: package pers.zhb. ...
- cjss 像编写css 一样开发web应用
cjss 提供了使用类似css 的方式编写web 应用 cjss 包含的阶段 data prepare body element 几点说明 并不是所以阶段必须使用,但是每个级别只能存在一个script ...
- 79: cf 444E 并查集+思维
$des$ 题面 $sol$ 把边从小到大排序,枚举每条边作为答案,然后把两个点合并,判断每条边是否可以作为答案时,$cnt_i$ 表示节点 $i$ 已经合并的 $x$ 之和$size_i$ 表示已经 ...
- 小数据池/is和==/再谈编码作业
# 1,老男孩好声选秀大赛评委在打分的时候呢, 可以输入分数. 假设, 老男孩有10个评委. 让10个评委进行打分, 要求, 分数必须高于5分, 低于10分.将每个评委的打分情况保存在列表中. pin ...
- (16)Go文件处理
package main import ( "bufio" "fmt" "os" ) func main() { // 新建文件 file, ...
- hdoj - 1248 寒冰王座
Problem Description 不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前.死亡骑 ...
- [RoarCTF]Easy Java
目录 [RoarCTF]Easy Java 知识点 1.WEB-INF/web.xml泄露 [RoarCTF]Easy Java 题目复现链接:https://buuoj.cn/challenges ...
- Lararel安装和虚拟主机配置
Laravel 对系统有些要求,当然,所有这些要求 Laravel Homestead 虚拟机都能满足,因此强烈推荐你使用 Homestead 作为你的开发环境. 当然,假如你不使用 Homestea ...