出错提示 | 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就可以啦