operator DEBUG_NEW' is not a recognized operator or type 是怎么回事?

梓潼ok 2012-12-25 11:51:59
--Configuration: test - Win32 Debug--------------------
Compiling...
testDlg.cpp
d:\program files (x86)\microsoft visual studio\vc98\include\crtdbg.h(536) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type
d:\program files (x86)\microsoft visual studio\vc98\include\crtdbg.h(536) : error C2059: syntax error : 'newline'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2059: syntax error : 'newline'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afx.h(674) : error C2238: unexpected token(s) preceding ';'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2059: syntax error : 'newline'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afx.h(675) : error C2238: unexpected token(s) preceding ';'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2059: syntax error : 'newline'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afx.h(683) : error C2238: unexpected token(s) preceding ';'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afx.h(1631) : error C2833: 'operator DEBUG_NEW' is not a recognized operator or type
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afx.h(1631) : error C2059: syntax error : 'newline'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afxtls_.h(122) : error C2059: syntax error : 'string'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2091: function returns function
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2802: static member 'operator new' has no formal parameters
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afxtls_.h(123) : error C2333: 'new' : error in function declaration; skipping function body
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afxtls_.h(131) : error C2059: syntax error : 'string'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afxtls_.h(131) : error C2091: function returns function
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afxtls_.h(131) : error C2802: static member 'operator new' has no formal parameters
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afxtls_.h(135) : error C2059: syntax error : 'string'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afxtls_.h(135) : error C2091: function returns function
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afxtls_.h(135) : error C2556: 'void *(__cdecl *__stdcall CNoTrackObject::operator new(void))(unsigned int,const char *,int)' : overloaded function differs only by return type from 'void
*(__cdecl *__stdcall CNoTrackObject::operator new(void))(unsigned int)'
d:\program files (x86)\microsoft visual studio\vc98\mfc\include\afxtls_.h(131) : see declaration of 'new'
执行 cl.exe 时出错.

testDlg.obj - 1 error(s), 0 warning(s)
...全文
572 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
kingkian 2013-04-30
  • 打赏
  • 举报
回复
我也遇到这种问题了, 我把#include ..提到 #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif 前面就好了
梓潼ok 2012-12-28
  • 打赏
  • 举报
回复
引用 4 楼 jingcxin 的回复:
能出这么多错误需要工作量啊,除非环境配的不对
重新把debug 文件删除就可以 重新编译!!!
静c心 2012-12-28
  • 打赏
  • 举报
回复
能出这么多错误需要工作量啊,除非环境配的不对
梓潼ok 2012-12-27
  • 打赏
  • 举报
回复
引用 2 楼 VisualEleven 的回复:
#ifdef _DEBUG #define new DEBUG_NEW #endif ????
我把debug 文件夹删除了 重新编译就好了
Eleven 2012-12-26
  • 打赏
  • 举报
回复
#ifdef _DEBUG #define new DEBUG_NEW #endif ????
Chivalry 2012-12-26
  • 打赏
  • 举报
回复
应该是你代码里面有一些语法或者书写上的一些错误,导致编译器对代码的解析偏离了正常,才出现这种比较少见的报错提示

1,659

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 非技术类
社区管理员
  • 非技术类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧