今天用vc7.1建了个支付MFC的控制台测试工程,用TUT单元测试框架.在包含:
时,出现 error C2061: 语法错误 : 标识符“_Wherenode” 的错误.
这肯定是MFC捣的鬼.因为我用纯console工程时,没有这个出错的.
上网google了下,在一国外网站找到了答案:是DEBUG_NEW宏搞的鬼.只要xtree.h包含在定义这个宏之前,就会出现这个错误.不知MS在搞什么...
把包含xtree.h的文件(比如<map>,比如本帖里提到的tut.hpp或ut_reporter.hpp)放在
之前就好了.
-----------------------------
有这个错误的样板:
改为如下顺序就没这个错误了:
- #include <tut/tut.hpp>
- #include <tut/tut_reporter.hpp>
时,出现 error C2061: 语法错误 : 标识符“_Wherenode” 的错误.
这肯定是MFC捣的鬼.因为我用纯console工程时,没有这个出错的.
上网google了下,在一国外网站找到了答案:是DEBUG_NEW宏搞的鬼.只要xtree.h包含在定义这个宏之前,就会出现这个错误.不知MS在搞什么...
把包含xtree.h的文件(比如<map>,比如本帖里提到的tut.hpp或ut_reporter.hpp)放在
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
之前就好了.
-----------------------------
有这个错误的样板:
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- #include <tut/tut.hpp>
- #include <tut/tut_reporter.hpp>
改为如下顺序就没这个错误了:
- #include <tut/tut.hpp>
- #include <tut/tut_reporter.hpp>
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif