解决方式

项目工程右键->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错误的更多相关文章

  1. 解决错误 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 ...

  2. 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 ...

  3. 【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 ...

  4. Unexpected end of file from server 服务器访问问题导致

    Caused by: java.net.SocketException: SocketException invoking http://xxxx/cxf/xh/creditInterface?wsd ...

  5. SHELL syntax error:unexpected end of file 提示错误

    SHELL syntax error:unexpected end of file 提示错误 if [ -n "$1" ] then " else " fi e ...

  6. linux经常使用(一)linux 安装配置 jdk之 找不到安装文件文件夹及source /etc/profile 报unexpected end of file 错误 解决

    linux 安装配置 jdk 应该算是一个非常主要的东西.可是我到如今才自己第一次 正式安装.果然出现了问题.. 问题就是 安装之后 找不到 安装路径 ,进而没法配置环境变量. 现象例如以下: 提示 ...

  7. 【问题解决】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: ./ ...

  8. Exception: Unexpected End Of File(crontab)

    Exception: Unexpected End Of File [solphire@hadoop02 tools]$ crontab -l 1 * * * * source /etc/profil ...

  9. freemarker.core.ParseException:Unexpected end of file reached

    1.错误原因 freemarker.core.ParseException:Unexpected end of file reached 2.错误原因 由于在宏定义中,运用组件时没有关闭标签,导致出错 ...

随机推荐

  1. 笨办法学Python

    打印:%r%r 与 %s 的区别就好比 repr() 函数处理对象与 str() 函数处理对象的差别.%s => str(),比较智能%r => repr(),处理较为简单和直接 from ...

  2. PostgreSQL JSON 处理

    1.JSON类型    PostgreSQL支持JSON和JSONB.这两种类型在使用上几乎完全一致,主要区别是: (1)JSON类型把输入的数据原封不动的存放到数据库中.JSONB类型在存放时把JS ...

  3. CDH 6.0.1 版本 默认配置下 HUE | happybase 无法访问 Hbase 的问题

    第一个问题 HUE 无法直接连接到 HBase 在默认配置下 CDH 6.0.1 版本下的 HBase2.0 使用了默认配置 hbase.regionserver.thrift.compact = T ...

  4. python 获取 一个正整数的二进制

    #coding=utf- def getbin(a): out = "" # 辗转相除法 ): div = a mod = a % out += str(mod) ): break ...

  5. 怎么在浏览器设置cookie

    document.cookie="jwt=xxxxxx" 遇到了一个bug 开了代理没有办法做图片上传

  6. 文档流&浮动&定位

    文档流指元素在文档中的位置由元素在html里的位置决定,块级元素独占一行,自上而下排列:内联元素从左到右排列脱离文档流的方式: 浮动,通过设置float属性 绝对定位,通过设置position:abs ...

  7. git之fatal: Could not read from remote repository

    问题背景:在git bash中使用hexo g -d命令进行文章发布 详细错误信息: fatal: Could not read from remote repository. Please make ...

  8. 用DLL方式封装MDI子窗体

    用DLL方式封装MDI子窗体是一种常用的软件研发技术,他的长处: 研发人员能够负责某一个模块的编写包括(界面+逻辑),能够互不干扰,模块研发完成后,主程式统一调用. 易于程式升级,当程式升级时,不用编 ...

  9. MySql通过数据库文件恢复数据库

    以表”Table”为例: 如类型是MyISAM, 数据文件则以”Table.frm””Table.MYD””Table.MYI””三个文件存储于”/data/$databasename/”目录中. 如 ...

  10. java excel给单元格增加批注(包含SXSSF)

    package javatest; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi ...