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.

  • 相关阅读:
    页面性能
    js运行机制
    渲染机制
    通信类
    js面向对象 继承
    原型
    [HEOI2016/TJOI2016]求和
    「NOIP2018 保卫王国」
    「LGP4719【模板】动态dp」
    多项式进阶操作
  • 原文地址:https://www.cnblogs.com/hehehaha/p/6332174.html
Copyright © 2011-2022 走看看