错误error C2665: 'operator new' : none of the 5 overloads could convert all the argument types

来源:互联网 发布:工业控制软件 编辑:程序博客网 时间:2024/05/16 11:29
error C2665: 'operator new' : none of the 5 overloads could convert all the argument types

据说是因为STL与DEBUG NEW运算符的冲突(影响list、vector等)

解决方法1:注释掉以下代码:
#ifdef _DEBUG
#define new DEBUG_NEW
#endif

解决方法2:
将:代码中的#include <vector>移到stdafx.h的开头,也就是#program once的后面。

两种方法都可以。