error C2061: 语法错误 : 标识符“_Wherenode” 的错误

   今天用vc7.1建了个支付MFC的控制台测试工程,用TUT单元测试框架.在包含:
  1. #include <tut/tut.hpp>
  2. #include <tut/tut_reporter.hpp>

时,出现 error C2061: 语法错误 : 标识符“_Wherenode” 的错误.
这肯定是MFC捣的鬼.因为我用纯console工程时,没有这个出错的.
   上网google了下,在一国外网站找到了答案:是DEBUG_NEW宏搞的鬼.只要xtree.h包含在定义这个宏之前,就会出现这个错误.不知MS在搞什么...
    把包含xtree.h的文件(比如<map>,比如本帖里提到的tut.hpp或ut_reporter.hpp)放在
  1. #ifdef _DEBUG
  2. #define new DEBUG_NEW
  3. #endif

之前就好了.

-----------------------------
有这个错误的样板:
  1. #ifdef _DEBUG
  2. #define new DEBUG_NEW
  3. #endif
  4. #include <tut/tut.hpp>
  5. #include <tut/tut_reporter.hpp>

改为如下顺序就没这个错误了:
  1. #include <tut/tut.hpp>
  2. #include <tut/tut_reporter.hpp>
  3. #ifdef _DEBUG
  4. #define new DEBUG_NEW
  5. #endif
  
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值