MFC莫名其妙的103个错误

MFC莫名其妙的103个错误,怎么解决今天编写程序,不知道改了什么,一运行之后,好家伙103个错误外加五个警告。我只是随便贴一点,让大家看看:

D:\VC98\MFC\SRC\WINCORE.CPP(38) : warning C4273: 'public: static class CWnd const CWnd::wndTop' : inconsistent dll linkage. dllexport assumed.D:\VC98\MFC\SRC\WINCORE.CPP(38) : error C2491: 'CWnd::wndTop' : definition of dllimport static data member not allowedD:\VC98\MFC\SRC\WINCORE.CPP(39) : warning C4273: 'public: static class CWnd const CWnd::wndBottom' : inconsistent dll linkage. dllexport assumed.D:\VC98\MFC\SRC\WINCORE.CPP(39) : error C2491: 'CWnd::wndBottom' : definition of dllimport static data member not allowedD:\VC98\MFC\SRC\WINCORE.CPP(40) : warning C4273: 'public: static class CWnd const CWnd::wndTopMost' : inconsistent dll linkage. dllexport assumed.D:\VC98\MFC\SRC\WINCORE.CPP(40) : error C2491: 'CWnd::wndTopMost' : definition of dllimport static data member not allowedD:\VC98\MFC\SRC\WINCORE.CPP(41) : warning C4273: 'public: static class CWnd const CWnd::wndNoTopMost' : inconsistent dll linkage. dllexport assumed.D:\VC98\MFC\SRC\WINCORE.CPP(41) : error C2491: 'CWnd::wndNoTopMost' : definition of dllimport static data member not allowedD:\VC98\MFC\SRC\WINCORE.CPP(43) : error C2065: 'AFX_WND' : undeclared identifierD:\VC98\MFC\SRC\WINCORE.CPP(43) : error C2440: 'initializing' : cannot convert from 'int' to 'const char []' There are no conversions to array types, although there are conversions to references or pointers to arraysD:\VC98\MFC\SRC\WINCORE.CPP(44) : error C2065: 'AFX_WNDCONTROLBAR' : undeclared identifierD:\VC98\MFC\SRC\WINCORE.CPP(44) : error C2440: 'initializing' : cannot convert from 'int' to 'const char []' There are no conversions to array types, although there are conversions to references or pointers to arraysD:\VC98\MFC\SRC\WINCORE.CPP(45) : error C2065: 'AFX_WNDMDIFRAME' : undeclared identifierD:\VC98\MFC\SRC\WINCORE.CPP(45) : error C2440: 'initializing' : cannot convert from 'int' to 'const char []' There are no conversions to array types, although there are conversions to references or pointers to arraysD:\VC98\MFC\SRC\WINCORE.CPP(46) : error C2065: 'AFX_WNDFRAMEORVIEW' : undeclared identifierD:\VC98\MFC\SRC\WINCORE.CPP(46) : error C2440: 'initializing' : cannot convert from 'int' to 'const char []' There are no conversions to array types, although there are conversions to references or pointers to arrays…………

 

是不是头皮麻啦?这只是一部分。当时我可是傻眼啦,我知道本来好好的,一下子出现这么多错误,一定不是程序的错误,一定是那个地方设置错误。于是呢,我就开始在网上找答案,但是总不能把这103个错误在网上搜着找吧?一个个的弄,但是,还是不行。后来,发生转机啦。我发现有人和我遇到了同样的问题,他们的解决方法大部分是把每一个CPP文件设置成不需要预编译头文件,我想试试,但是试了几个,一点效果没有。人家让每一个都试,可能是因为偷懒吧,我接着在网上找,大部分都是这样说的,我晕啦!终于遇到说要修改“WINCORE.cpp”文件,但是,我不知道怎么修改啊?我想着在其他运行正确的程序中直接找一个copy过来不得了,与是呢,我就在其他运行正确的文件找,但是,搞不清楚,这个文件怎么还找不到。然后,我又在该工程下去找这个文件,但是奇怪的事情发生了,在VC++6.0工作空间明明看着“WINCORE.cpp”在那儿,但是在工程目录下却找不到。于是呢,我仔细看看别人的介绍,奥,明白了,是把它删除而不是修改。于是,在工作空间选中,Delete,然后运行,谢天谢地啊,这103个错误伴随着这一个文件都没有啦,我那心情感动的要死。 所以我想说的就是,以后解决问题的时候,看别人的解释的时候,一定要认真,不然,像我,这样,不认真,一个多小时就这样不小心给丢了,太浪费啦,所以,兄弟姐妹们,干什么事都认真点吧。祝看过这篇文章的人好运 ~_~!

 **************************************************************************************** 添加:今天不知道怎么回事,本来运行好好的程序,突然又出现了38个错误,纠结ing~~~D:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\DLGCORE.CPP(45) : warning C4273: 'protected: static struct AFX_MSGMAP const CDialog::messageMap' : inconsistent dll linkage. dllexport assumed.D:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\DLGCORE.CPP(45) : error C2491: 'CDialog::messageMap' : definition of dllimport static data member not allowedD:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\DLGCORE.CPP(52) : error C2065: 'WM_COMMANDHELP' : undeclared identifierD:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\DLGCORE.CPP(53) : error C2065: 'WM_HELPHITTEST' : undeclared identifierD:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\DLGCORE.CPP(58) : error C2065: 'WM_QUERY3DCONTROLS' : undeclared identifierD:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\DLGCORE.CPP(81) : error C2065: '_AfxCompareClassName' : undeclared identifierD:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\DLGCORE.CPP(101) : error C2065: 'IS_COMMAND_ID' : undeclared identifierD:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\DLGCORE.CPP(171) : error C2065: '_AfxCheckDialogTemplate' : undeclared identifier…………

怎么调试都调试不出来,好来想的上次出现的“WINCORE.cpp”文件,这次我又找,但是没有找到,但是我仔细看了一下我的工作空间,上面多了一个“DLGCORE.CPP”,这不禁让我把两件事情联系到一块儿,但是,我可不敢武断的删除,于是我打开一个正常的程序,发现这个文件并不存在,又到对应的文件中找,还是没找到,我仔细一看,原来这个文件是VC++6.0自带的文件,于是,在工作空间删除了该文件,一运行,OK,搞定了!不过,至今还没搞清楚这个问题。希望明白的人帮忙!

 *******************************************************************************************************2012-4-9看来是坏事天天有,今年特别多,今天好像是单步调试的时候,本来好好的程序,出现了下面的提示71 error(s), 8 warning(s)随便粘一下:D:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\CMDTARG.CPP(51) : error C2027: use of undefined type 'COleDispatchImpl' d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(1721) : see declaration of 'COleDispatchImpl'D:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\CMDTARG.CPP(51) : error C2227: left of '->Disconnect' must point to class/struct/unionD:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\CMDTARG.CPP(69) : error C2079: 'mmf' uses undefined union 'MessageMapFunctions'D:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\CMDTARG.CPP(70) : error C2228: left of '.pfn' must have class/struct/union typeD:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\CMDTARG.CPP(76) : error C2027: use of undefined type 'AFX_CMDHANDLERINFO' d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(1303) : see declaration of 'AFX_CMDHANDLERINFO'D:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\CMDTARG.CPP(76) : error C2227: left of '->pTarget' must point to class/struct/union这次在网搜,别人的回答就是删除多余的文件,我看了一下,的确多出来一个文件“CMDTARG.cpp”,一看路径有时文件安装的路径,这次果断的删除,在重新编译一次,OK,搞定。这次我注意到一个人说的挺有道理的,内容如下: F5调试运行,我也碰到过这个问题,调试运行后,过了设的断点就进入了CMDTARG.CPP,然后关编辑器是应该会提示保存对CMDTARG.CPP的修改,我点了保存,之后也出现上面的错误。后来我试过不点保存就没有

摘自:http://topic.csdn.net/u/20100628/20/acb7e80a-1971-45f7-b776-e850a166c489.html问题还未解决,努力有待继续!

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值