• error LNK2005: 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删除。

  • 相关阅读:
    .NET实现Excel文件的读写 未测试
    权限管理设计
    struts1中配置应用
    POJ 2139 Six Degrees of Cowvin Bacon(floyd)
    POJ 1751 Highways
    POJ 1698 Alice's Chance
    POJ 1018 Communication System
    POJ 1050 To the Max
    POJ 1002 4873279
    POJ 3084 Panic Room
  • 原文地址:https://www.cnblogs.com/xuesongshu/p/4064251.html
Copyright © 2020-2023  润新知