在MFC的工程里placement new 编译会出现error
error C2061: syntax error : identifier 'p' 等
原因是MFC的cpp重新定义了new
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
去掉就好了。试了好久...
本文探讨了在MFC工程中使用placementnew出现语法错误的原因,并提供了简单的解决方案,通过移除特定预定义宏,即可修复该问题。
在MFC的工程里placement new 编译会出现error
error C2061: syntax error : identifier 'p' 等
原因是MFC的cpp重新定义了new
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
去掉就好了。试了好久...
853

被折叠的 条评论
为什么被折叠?