skipped when looking for precompiled header

Did you read the error message?

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

I don't see an #include "stdafx.h" in enginuity.cpp. ;) If you're using precompiled headers, you need to include the precompiled header in every source (.cpp) file.


I just experienced this error when including stdafx.h in a cpp file located in a parent folder above where stdafx.h is.

#include "subfolder\stdafx.h"

causes the compile error. Changing it to:

#include "stdafx.h"

fixes the compile error, but then intellisense freaks out.

The "fix" for intellisense, according to someone at Microsoft here, is to add "$(ProjectDir)" (or wherever the stdafx.h is) to the list of directories under Project->Properties->Configuration Propertes->C/C++->General->Additional Include Directories.

I've verified this works in Visual Studio 2012. Should work in 2010 as well.