C++中编译时的错误问题
来源:百度知道 编辑:UC知道 时间:2024/06/22 02:36:29
Linking...
DcDlg.obj : error LNK2005: "protected: static struct AFX_MSGMAP const * __stdcall CHOTELApp::_GetBaseMessageMap(void)" (?_GetBaseMessageMap@CHOTELApp@@KGPBUAFX_MSGMAP@@XZ) already defined in CpDlg.obj
DcDlg.obj : error LNK2005: "protected: virtual struct AFX_MSGMAP const * __thiscall CHOTELApp::GetMessageMap(void)const " (?GetMessageMap@CHOTELApp@@MBEPBUAFX_MSGMAP@@XZ) already defined in CpDlg.obj
DcDlg.obj : error LNK2005: "public: __thiscall CHOTELApp::CHOTELApp(void)" (??0CHOTELApp@@QAE@XZ) already defined in CpDlg.obj
DcDlg.obj : error LNK2005: "public: virtual int __thiscall CHOTELApp::InitInstance(void)" (?InitInstance@CHOTELApp@@UAEHXZ) already defined in CpDlg.obj
DcDlg.obj : error LNK2005: "public: virtual int __thiscall CHOTELApp::ExitInstance(void)" (?ExitInstance@CHOTELApp@@UAEHXZ) already defined in CpDlg.obj
DcDlg.obj : error LNK2005: "protected: static struct AFX_MSGMAP const
DcDlg.obj : error LNK2005: "protected: static struct AFX_MSGMAP const * __stdcall CHOTELApp::_GetBaseMessageMap(void)" (?_GetBaseMessageMap@CHOTELApp@@KGPBUAFX_MSGMAP@@XZ) already defined in CpDlg.obj
DcDlg.obj : error LNK2005: "protected: virtual struct AFX_MSGMAP const * __thiscall CHOTELApp::GetMessageMap(void)const " (?GetMessageMap@CHOTELApp@@MBEPBUAFX_MSGMAP@@XZ) already defined in CpDlg.obj
DcDlg.obj : error LNK2005: "public: __thiscall CHOTELApp::CHOTELApp(void)" (??0CHOTELApp@@QAE@XZ) already defined in CpDlg.obj
DcDlg.obj : error LNK2005: "public: virtual int __thiscall CHOTELApp::InitInstance(void)" (?InitInstance@CHOTELApp@@UAEHXZ) already defined in CpDlg.obj
DcDlg.obj : error LNK2005: "public: virtual int __thiscall CHOTELApp::ExitInstance(void)" (?ExitInstance@CHOTELApp@@UAEHXZ) already defined in CpDlg.obj
DcDlg.obj : error LNK2005: "protected: static struct AFX_MSGMAP const
重复定义了。
你那程序在链接时就出错了,这也不好说,你是不是把头文件写掉了。
消息映射的出了问题
估计是删除了MESSAGE_MAP类似的代码
你对比一个正常的Dlg类看看, 主要看看消息映射的部分