Print Page | Close Window

Unicode linker errors

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=882
Printed Date: 19 July 2025 at 8:56am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Unicode linker errors
Posted By: Andy
Subject: Unicode linker errors
Date Posted: 23 June 2004 at 9:05am

Hi,

I'm getting problems building a very simple project with Unicode support when using XTPro 8.70 and VisualStudio 7.1. The process is easy to repeat:

1. Create a new project in VisualStudio: MFC MDI Application, use all defaults
2. Follow the steps described in the "XTPro Users Guide", "Tutorials - Create an application that has Office style toolbars and menus"

This compiles and runs OK. Now:

3. In the project settings, set "Use Unicode Character Set" and define "_UNICODE" in the preprocessor settings.

Now compiles with the following errors:

MainFrm.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class CXTPToolBar * __thiscall CXTPCommandBars::Add(class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > >,enum XTPBarPosition,struct CRuntimeClass *)" (__imp_?Add@CXTPCommandBars@@QAEPAVCXTPToolBar@@V?$CStringT@ _WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@W4XTPB arPosition@@PAUCRuntimeClass@@@Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z)

MainFrm.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class CXTPMenuBar * __thiscall CXTPCommandBars::SetMenu(class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > >,unsigned int)" (__imp_?SetMenu@CXTPCommandBars@@QAEPAVCXTPMenuBar@@V?$CStri ngT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@I@ Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z)

The problem appears to happen if you use a VisualStudio 7.1 project as your starting point. We've used XTPro with projects created in VisualStudio 6 with Unicode in the past and they worked OK. Similarly, the demo projects that come with XTPro also appear to compile OK in Unicode.

Any help fixing this would be appreciated as it's stopping the development of a new Unicode program.



-------------
--
Andy



Replies:
Posted By: Andy
Date Posted: 25 June 2004 at 5:35am

Hi,

Just to thank Oleg and Kirk at Codejock for solving this one. The problem was fixed by setting "Treat wchar as Built-In type" to "No" in the "C / C++ > Language" project settings.

Many thanks to them for their support :)

Best regards,



-------------
--
Andy



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