VS 总是寻找预编译 headers

VS Always looks for precompiled headers

我正在使用 VS Community 2015 创建 C++ 控制台应用程序

我正在尝试停止使用 pre-compiled headers。

我已删除 #include "stdafx.h" 以及 stdafx .h 和 cpp 文件。

在我选择的项目属性页面中

Not Using Precompiled Headers

我试过清理、重建,但没有任何效果。

VS一直在寻找预编译的headers:

1>ConsoleApplication2.cpp(7): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?

有人有解决办法吗?

可以在单个源文件级别覆盖 VS 项目属性。检查 ConsoleApplication2.cpp 的属性(以及其他出现错误的源文件)并确保它们的 PCH-related 属性未加粗,即它们处于 "inherit from parent or project defaults."

状态

还要确保您正在编辑您实际构建的配置(例如 "Debug")的属性。 VS 属性 对话框允许您编辑任何配置的属性,而不仅仅是当前在 solution-wide 配置组合中选择的那个。我通常做的是在退出之前总是将对话框的配置设置为"Active"选项,这样当我打开它时,我就不用检查了。