PCH Warning: header stop cannot be in a macro or #if block.
在编写头文件时,遇到这么一个warning:PCH Warning: header stop cannot be in a macro or #if block. An intellisense PCH file was not generated.
查询后大概原因是这样:
如果一个头文件在你的工程或解决方案中,没有被任何其他.c/cpp文件包含(include),那么就很有可能获得一个PCH warning。
If the header is not included by any cpp file in your project/solution, you could potentially get a PCH warning. This is because our intellisense engine works with translation units instead of individual files. A translation unit is essentially a .c/cpp file and all the header files that were included. When a header file, say x.h, is opened, VS searches the include graph and find a suitable c/cpp file that includes x.h use that as the translation unit for the intellisense engine. However, if x.h is not found in the include graph (ie. not included by any .c/cpp file in the project), then the intellisense engine will use the header file itself as the translation unit (eg. treating that header file as a .c/cpp file). In that case, the intellisense engine won’t be able to generate the iPCH due to the reason described by the error message itself. As you already know, you can work around this by including the problematic headers in a .c/cpp file.
解决:
在该cpp文件的开头加上#pragma once
PCH Warning: header stop cannot be in a macro or #if block.的更多相关文章
- C1853 编译器错误:fatal error C1853: 'pjtname.pch' precompiled header file is from a previous
转载:https://www.cnblogs.com/emanlee/archive/2010/10/16/1852998.html 用VC++ 2008 编写C语言程序,编译出现错误: 预编译头文件 ...
- xcode6以后, 使用.pch
http://blog.csdn.net/lihuiqwertyuiop/article/details/39268101 总结: . 创建.pch文件 . Apple LLVM 6.1 - Lang ...
- xcode6中如何添加pch文件
在Xcode6之前,新建一个工程的时候,系统会帮我们自动新建一个以工程名为名字的pch (precompile header)文件,在开发过程中,可以将那些整个工程都广泛使用的头文件包含在该文件下,编 ...
- 在工程中添加pch文件
在Xcode6之前,新建一个工程的时候,系统会帮我们自动新建一个以工程名为名字的pch (precompile header)文件,在开发过程中,可以将那些整个工程都广泛使用的头文件包含在该文件下,编 ...
- PrefixHeader.pch' file not found 以及 Xcode 中如何添加pch文件
在开发的过程中,有时候接触到旧项目,会报: 'PrefixHeader.pch' file not found 的错误! 在Xcode6之前,新建一个工程的时候,系统会帮我们自动新建一个以工程名为名字 ...
- iOS布局---pch头文件设置和字号适配
由于4s,5s,6,6p,界面尺寸差别过大,如果在界面上,只是用同一个字号,在4s和5s上就会略显偏大,而在6p上就会显小.并且ios9系统原生字体相较于ios8和之前原生字体略粗,在字号上也错了一号 ...
- PE Header and Export Table for Delphi
Malware Analysis Tutorial 8: PE Header and Export Table 2. Background Information of PE HeaderAny bi ...
- VC 宏与预处理使用方法总结
目录(?) C/C++ 预定义宏^ C/C++ 预定义宏用途:诊断与调试输出^ CRT 和 C 标准库中的宏^ NULL 空指针^ limits.h 整数类型常量^ float.h 浮点类型常量^ m ...
- ARC中用代码检测一个对象有没有释放掉
ARC中用代码检测一个对象有没有释放掉 你试过在ARC中用代码检测对象有没有释放掉这种事情呢?即使你想过肯定也不知道怎么去实现,因为,这里会用到一个你基本上没怎么接触过的类:NSHashTable. ...
随机推荐
- oj2894(贝尔曼福特模板)
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2894 就因为粗心,一中午没A,题目说是2000 ...
- OBV_X3
{OBV_X3[背景]考虑到OBV_X03在情况1的时候,采用的是寻找波段线的同价K线,但是由于此种情况下必须使用CONST(C)或通过输入参数CONSTCC设定固定值,无法当前K线的CLOSE同时变 ...
- PhoneGap+Cordova+SenchaTouch-01-环境搭建
转http://my.oschina.net/zhongwenhao/blog/369465 环境搭建基于 windows ,mac系统可以借鉴 1.安装NodeJS 和ruby http://no ...
- 010-centos上安装matlab
#001-下载matlab_R2015b和破解文件(四个)到百度云盘上下载7.6g#002-上传matlab大文件先安装vm tools,然后直接复制到虚拟机桌面#003-挂载matlab镜像并安装m ...
- font-awesome图标
- Codeforces Round #440 (Div. 2, based on Technocup 2018 Elimination Round 2) C. Maximum splitting
地址: 题目: C. Maximum splitting time limit per test 2 seconds memory limit per test 256 megabytes input ...
- [转]autoid文件上传
原文地址:https://www.cnblogs.com/yoyoketang/p/7612026.html 前言 关于非input文件上传,点上传按钮后,这个弹出的windows的控件了,已经跳出三 ...
- C++飞机大战
#include<windows.h> #include"resource.h" #include<stdlib.h> #include<time.h ...
- AVPlayerLayer
AVPlayerLayer 最后一个图层类型是AVPlayerLayer.尽管它不是Core Animation框架的一部分(AV前缀看上去像),AVPlayerLayer是有别的框架(AVFound ...
- 页面点击,不是a标签也会刷新原因
页面点击,不是a标签也会刷新原因 点击事件冒泡,触发了a链接导致整个页面刷新了.直接阻止 事件冒泡即可 例子: $("tr .am-text-danger").click(func ...