zoukankan      html  css  js  c++  java
  • PCH Warning: header stop cannot be in a macro or #if block.

    在编写头文件时,遇到这么一个warningPCH 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.

  • 相关阅读:
    吃货联盟订餐系统
    第一章课后习题
    hostapd阅读(openwrt)-1
    通过C语言获取MAC地址(转)
    OpenWrt 编译分割
    ubuntu 12.04无盘工作站
    WEB前端性能优化-如何提高页面加载速度
    HTML6
    easyui 根据值查找匹配
    收藏的网站
  • 原文地址:https://www.cnblogs.com/hehehaha/p/6332174.html
Copyright © 2011-2022 走看看