Print Page | Close Window

Linking problems

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: General Discussion
Forum Description: Topics Related to Visual C++ MFC Development in General
URL: http://forum.codejock.com/forum_posts.asp?TID=14893
Printed Date: 30 January 2025 at 6:51pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Linking problems
Posted By: Tsenoh
Subject: Linking problems
Date Posted: 03 August 2009 at 11:34am
Hello!

I've had CommandBars1200vc80 dynamically linked in my project. Now we want to link MFC statically. After setting /MT flag in our project, we get a ton of linking errors like this:


1>CommandBars1200vc80S.lib(XTPCommandBars.obj) : error LNK2005: "public: void __thiscall CXTPCommandBars::EnableDocking(void)" (?EnableDocking@CXTPCommandBars@@QAEXXZ) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPCommandBars.obj) : error LNK2005: "public: void __thiscall CXTPCommandBars::SetSite(class CWnd *)" (?SetSite@CXTPCommandBars@@QAEXPAVCWnd@@@Z) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPCommandBars.obj) : error LNK2005: "public: void __thiscall CXTPCommandBars::UpdateCommandBars(void)const " (?UpdateCommandBars@CXTPCommandBars@@QBEXXZ) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPCommandBars.obj) : error LNK2005: "public: int __thiscall CXTPCommandBars::OnFrameWndMsg(unsigned int,unsigned int,long,long *)" (?OnFrameWndMsg@CXTPCommandBars@@QAEHIIJPAJ@Z) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPCommandBars.obj) : error LNK2005: "public: void __thiscall CXTPCommandBars::SetQuickCustomizeMode(int)" (?SetQuickCustomizeMode@CXTPCommandBars@@QAEXH@Z) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPCommandBars.obj) : error LNK2005: "public: void __thiscall CXTPCommandBars::SetCustomizeMode(int)" (?SetCustomizeMode@CXTPCommandBars@@QAEXH@Z) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPCommandBars.obj) : error LNK2005: "public: void __thiscall CXTPCommandBars::SetPaintManager(class CXTPPaintManager *)" (?SetPaintManager@CXTPCommandBars@@QAEXPAVCXTPPaintManager@@@Z) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPCommandBars.obj) : error LNK2005: "public: void __thiscall CXTPCommandBars::SetTheme(enum XTPPaintTheme)" (?SetTheme@CXTPCommandBars@@QAEXW4XTPPaintTheme@@@Z) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPCommandBars.obj) : error LNK2005: "public: class CXTPToolBar * __thiscall CXTPCommandBars::Add(char const *,enum XTPBarPosition,struct CRuntimeClass *)" (?Add@CXTPCommandBars@@QAEPAVCXTPToolBar@@PBDW4XTPBarPosition@@PAUCRuntimeClass@@@Z) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPCommandBars.obj) : error LNK2005: "public: int __thiscall CXTPCommandBars::PreTranslateFrameMessage(struct tagMSG *)" (?PreTranslateFrameMessage@CXTPCommandBars@@QAEHPAUtagMSG@@@Z) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPPaintManager.obj) : error LNK2005: "public: virtual void __thiscall CXTPPaintManager::UpdateColors(void)" (?UpdateColors@CXTPPaintManager@@UAEXXZ) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPPaintManager.obj) : error LNK2005: "public: virtual int __thiscall CXTPPaintManager::GetPopupBarGripperWidth(class CXTPCommandBar *)" (?GetPopupBarGripperWidth@CXTPPaintManager@@UAEHPAVCXTPCommandBar@@@Z) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)
1>CommandBars1200vc80S.lib(XTPPaintManager.obj) : error LNK2005: "public: virtual class CFont * __thiscall CXTPPaintManager::GetCommandBarFont(class CXTPCommandBar *,int)" (?GetCommandBarFont@CXTPPaintManager@@UAEPAVCFont@@PAVCXTPCommandBar@@H@Z) already defined in CommandBars1200vc80.lib(CommandBars1200vc80.dll)


Any idea what is wrong and how can i change it?

Thanks,

Bojan Hrnkas



Replies:
Posted By: mgampi
Date Posted: 03 August 2009 at 11:50am
Did you clean and rebuild the whole project?



-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: mgampi
Date Posted: 03 August 2009 at 11:52am
Another hint;
Check your linker dependencies. Perhaps you forgot to remove a manually added dependency for
CommandBars1200vc80.lib


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: Tsenoh
Date Posted: 03 August 2009 at 11:53am
Ok, forget it. I still had CommandBars1200vc80.lib in the include libraries option in linker.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net