Is there a way to use pre-compiled headers in VC++ without requiring stdafx.h?
Regarding the first answer to this question above,
I tried to implement his solution using visual studio 2010, and failed:
fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
Any ideas?
The objective is to NOT use #include "StdAfx.h"
anywhere, but instead decide on whether or not to use it during compile time.
If /Yc or Yu are not used, #pragma hdrstop
has no effect
If /Yu is used, #pragma hdrstop
is replaced with #include "StdAfx.h"
, or at least thats t开发者_运维技巧he claimed behavior.
The error message indicates that you had option /Yu "StdAfx.h" when compiling. The answer suggested to leave that "StdAfx.h" part of /Yu option blank.
精彩评论