My app is working correctly, but I'm trying to clear up something. When I include the precompile header in my source files, I get the following happen.
Basically the first line is underlined as if there is a problem with it, so I have to include it again underneath, with the correct path... but I need both or it wont compile.
Any ideas?
The Visual Studio uses precompiled header only if the name matches (the name is not case-sensitive). Let say, a precompiled header name StdAfx.h
is set in your project, so only when a code contains #include "stdafx.h"
then is precompiled header used.
The #include "..\stdafx.h"
is not recognized as the precompiled header even though it is the real location.
You need to add an include path to the location of stdafx.h into your project settings and then the header #include "stdafx.h"
will be work correctly.
Another common issue with a precompiled header is that the include directive is in a header. It should be always in the source file (.ccp).