c++visual-studiovisual-studio-2015visual-studio-community

VS Always looks for precompiled headers


I am Using VS Community 2015 to create C++ Console applications

I am trying to stop using pre-compiled headers.

I have deleted #include "stdafx.h" , and the stdafx .h and cpp files.

In the project properties pages I selected

Not Using Precompiled Headers

I tried clean, rebuild, nothing works.

VS keeps looking for the precompiled 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?

Anyone have a solution?


Solution

  • VS project properties can be overridden on individual source file level. Inspect the properties of ConsoleApplication2.cpp (and other source files where you get errors) and make sure their PCH-related properties are not bolded, i.e. that they are in the state "inherit from parent or project defaults."

    Also make sure that you are editing properties for the configuration (e.g. "Debug") which you are actually building. The VS property dialog allows you to edit properties for any configuration, not just the one currently selected in the solution-wide configuration combo. What I usually do is to always set the dialog's configuration to the "Active" option before exiting it, so that when I open it, I don't have to check.