Fatal Error C1010 - "Stdafx.H" in Visual Studio How Can This Be Corrected

fatal error C1010 - stdafx.h in Visual Studio how can this be corrected?

Look at https://stackoverflow.com/a/4726838/2963099

Turn off pre compiled headers:

Project Properties -> C++ -> Precompiled Headers

set Precompiled Header to "Not Using Precompiled Header".

C++ Precompiled Header Disabled

Ok. Hans Passant found out what was happening:

The build configuration that I used to build it still had precompiled headers enabled.

VS Always looks for precompiled headers

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.



Related Topics



Leave a reply



Submit