How to fix error C1010 without turning off precompiled headers?

So, I have to use pre-compiled headers in my VS 2005 project. Now I have a common source file that does not have #include "stdafx.h" ... How to include a common source file in a project without adding stdafx.h to the beginning of the source file and without disabling precompiled headers ??

+2


source to share


3 answers


File Properties -> C / C ++ -> Precompiled Headers -> Create / Use Precompiled Headers -> Don't Use ...



+7


source


Look in the properties (context menu) for this file under C / C ++ - Precompiled Header.

Change "Create / Use Precompiled Headers" to "Don't Use Precompiled Headers".



Note. I just tested this in VC ++ 2003 - this option may have moved to VC ++ 2005 or 2008, but I doubt it. However, even if it has moved, it shouldn't be hard to find it.

+1


source


You can also use the 'Force Include' option: "This option has the same effect as specifying a double-quoted file in the #include directive on the first line of every source file specified on the command line, in a CL environment variable, or in a command file. "

It is very convenient to enter PreCompiled Headers without changing all the source files ...

+1


source







All Articles