关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回

errorLNK2005:DDX_Control已经在uafxcwd.lib(wincore2.obj)中定义

发布时间:2022-07-27 13:54:37
编译错误提示:errorLNK2005:DDX
_Control已经在uafxcwd.lib(wincore2.obj)中定义
1>afxnmcdd.lib(wincore2.obj) : error LNK2005: "void __stdcall DDX_Control(classCDataExchange *,int,class CWnd &)" (?DDX_Control@@YGXPAVCDataExchange@@HAAVCWnd@@@Z)already defined in nafxcwd.lib(wincore2.obj)
1>afxnmcdd.lib(wincore2.obj) : error LNK2005: "public: int __thiscallCWnd::ExecuteDlgInit(void *)" (?ExecuteDlgInit@CWnd@@QAEHPAX@Z) already defined innafxcwd.lib(wincore2.obj)
1>afxnmcdd.lib(afxctrlcontainer2.obj) : error LNK2005: "void __cdeclAfxRegisterMFCCtrlClasses(void)" (?AfxRegisterMFCCtrlClasses@@YAXXZ) already definedin nafxcwd.lib(afxctrlcontainer2.obj)
1>afxnmcdd.lib(afxctrlcontainer2.obj) : error LNK2005: "protected: void __thiscallCMFCControlContainer::PreUnsubclassControl(class CWnd *)" (?PreUnsubclassControl@CMFCControlContainer@@IAEXPAVCWnd@@@Z) already defined innafxcwd.lib(afxctrlcontainer2.obj)
1>afxnmcdd.lib(afxctrlcontainer2.obj) : error LNK2005: "public: int __thiscallCMFCControlContainer::SubclassDlgControls(void)" (?SubclassDlgControls@CMFCControlContainer@@QAEHXZ) already defined innafxcwd.lib(afxctrlcontainer2.obj)
1>afxnmcdd.lib(afxctrlcontainer2.obj) : error LNK2005: "public: static int __stdcallCMFCControlContainer::UTF8ToString(char const *,class ATL::CStringT<char,classStrTraitMFC<char,class ATL::ChTraitsCRT<char> > > &,int)" (?UTF8ToString@CMFCControlContainer@@SGHPBDAAV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@H@Z) already defined in nafxcwd.lib(afxctrlcontainer2.obj)
1>.Debugapplication-ui.exe : fatal error LNK1169: one or more multiply definedsymbols found

原因分析:

  1、MFC工程引用了其它WIN32静态库

  2、WIN32静态库选择支持MFC。

解决办法:

  1、把所有WIN32静态库的stdafx.h文件中的一句代码#define _AFX_NO_MFC_CONTROLS_IN_DIALOGS删除。


/template/Home/DawnNew/PC/Static

立即注册风纳云账号,免费体验多款产品

立即注册