Problem with include guard

Posted by isurulucky on Stack Overflow See other posts from Stack Overflow or by isurulucky
Published on 2010-05-31T06:26:35Z Indexed on 2010/05/31 6:32 UTC
Read the original article Hit count: 297

Filed under:
|

When I add an include guard to my header file for a Visual C++ project, it gives me the following warning and error:

warning C4603: '_MAPTEST_H' : macro is not defined or definition is different after precompiled header use

Add macro to precompiled header instead of defining here

.\MapTest.cpp(6) : use of precompiled header** // the precompiled header stdafx.h is included in this line

.\MapTest.cpp(186) : fatal error C1020: unexpected #endif

but when I add the precompiled header before the include guard, no warning or error is emitted. What is the reason for this?

© Stack Overflow or respective owner

Related posts about visual-c++

Related posts about inclusion