当我添加一个包括后卫为Visual C++项目我的头文件,它给了我下面的警告和错误:问题与包括后卫
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
,但是当我添加预编译的头前,包括后卫,不会发出警告或错误。这是什么原因?
你能发表最少量的代码来重现这个问题吗? – 2010-05-31 06:31:55
以下划线开头并且后面跟着另一个下划线或大写字母的标识符被保留,请勿使用它们。 – GManNickG 2010-05-31 06:35:17
#ifndef _MAPTEST_H #define _MAPTEST_H #include“stdafx.h” _MAPTEST_H是包含名称。当我在宏定义之前放置预编译头时,工作正常。 – Izza 2010-05-31 06:36:15