您的位置:首页 > 其它

DEBUG_NEW 导致编译失败的问题

2010-12-16 10:15 309 查看
出错提示error C2665: 'operator new' : none of the 5 overloads could convert all the argument types
winxp+vs2005

在其他机器上debug版与release版本都可以编译成功

在本机编译不过,怀疑是VS2005有问题,事实上不是的,

a.h 中定义

#define new DEBUG_NEW

然后,b.h 中
#include "a.h"

b.cpp

#include "b.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

然后就编译不过啦

找到原因就好说啦,在a.h中,删除

#define new DEBUG_NEW就可以啦
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: