Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Unicode linker errors
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Unicode linker errors

 Post Reply Post Reply
Author
Message
Andy View Drop Down
Newbie
Newbie


Joined: 23 June 2004
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy Quote  Post ReplyReply Direct Link To This Post Topic: Unicode linker errors
    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
Back to Top
Andy View Drop Down
Newbie
Newbie


Joined: 23 June 2004
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.