编译器警告(等级 1)C4627

header_file”:在查找预编译标头使用时跳过

如果当前源文件具有 /Yu(使用预编译头文件)选项集,则编译器将忽略该文件中的所有内容,然后再包含预编译标头。 如果在预编译头文件之前包含 header_file 并且预编译标头也不包含 header_file,则会在 Visual Studio 2015 和早期版本中生成警告 C4627

示例

此示例演示了如何发生错误,并演示如何修复它:

// c4627.cpp
#include <iostream>       // C4627 - iostream not included by pch.h
#include "pch.h"          // precompiled header file that does not include iostream
// #include <iostream>    // To fix, move the iostream header include here from above
int main()
{
    std::cout << "std::cout is defined!\n";
}

另请参阅

创建预编译标头文件