"new" operation

Can someone help me: why the "new" operation cannot work in Debug version, while ok in Release version?

Example: (in Debug version)
Handle(AIS_Shape) aBox1 = new AIS_Shape(B1); error:
error C2661: 'Standard_Transient::operator new' : no overloaded function takes 3 arguments

Svetlozar Kostadinov's picture

Do you use MFC? It redefines the "new" operator in debug version to track the memory allocations. In every cpp the MFC wizzard adds the following snippet:

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

If you have this, try to comment it.

Wang Chris's picture

Thanks a lot! It works :-)