Author Topic: Link error Visual Studio 2005 with CwclServer  (Read 23797 times)

rdesgagn

  • Guest
Link error Visual Studio 2005 with CwclServer
« on: May 08, 2013, 12:21:26 AM »
Hello there,

I'm coding a dll that uses WCL.  When I try to get the device address and name in CwclServer , I get this weird link error from Visual Studio 2005.  I can only work in VS2005, there is no way I can upgrade to 2008 or newer.

error LNK2019: unresolved external symbol "__declspec(dllimport) public: class ATL::CStringT<unsigned short,class ATL::StrTraitATL<unsigned short,class ATL::ChTraitsCRT<unsigned short> > > __thiscall wcl::CwclCustomServerConnection::GetDeviceName(void)" (__imp_?GetDeviceName@CwclCustomServerConnection@wcl@@QAE?AV?$CStringT@GV?$StrTraitATL@GV?$ChTraitsCRT@G@ATL@@@ATL@@@ATL@@XZ) referenced in function "private: void __thiscall bluetoothCom::OnDisconnected(void *)" (?OnDisconnected@bluetoothCom@@AAEXPAX@Z)

I think the problem is related to ATLString being newer in the wcl.dll than what I have with Visual Studio 2005.

Thanks for your help,

Rene

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Link error Visual Studio 2005 with CwclServer
« Reply #1 on: May 08, 2013, 06:15:38 AM »
WCL uses UNICODE. Change your project options to use UNICODE instead of MuliByte.

rdesgagn

  • Guest
Re: Link error Visual Studio 2005 with CwclServer
« Reply #2 on: May 08, 2013, 02:53:47 PM »
Hi Mike,

Even by modifying project options to use Unicode character set, I still get this error.  Do you have any idea what it could be ?

Thanks

rdesgagn

  • Guest
Re: Link error Visual Studio 2005 with CwclServer
« Reply #3 on: May 08, 2013, 03:12:33 PM »
Hi Mike,

I check my Visual Studio project and every WCL functions that returns an ATL:CStringT has a linker error like this even if the unicode character is set in the project options :

bluetoothCom.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class ATL::CStringT<unsigned short,class ATL::StrTraitATL<unsigned short,class ATL::ChTraitsCRT<unsigned short> > > __thiscall wcl::CwclCustomServerConnection::GetDeviceName(void)" (__imp_?GetDeviceName@CwclCustomServerConnection@wcl@@QAE?AV?$CStringT@GV?$StrTraitATL@GV?$ChTraitsCRT@G@ATL@@@ATL@@@ATL@@XZ) referenced in function "private: void __thiscall bluetoothCom::OnDisconnected(void *)" (?OnDisconnected@bluetoothCom@@AAEXPAX@Z)

bluetoothCom.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class ATL::CStringT<unsigned short,class ATL::StrTraitATL<unsigned short,class ATL::ChTraitsCRT<unsigned short> > > __thiscall wcl::CwclAPI::GetVersion(void)" (__imp_?GetVersion@CwclAPI@wcl@@QAE?AV?$CStringT@GV?$StrTraitATL@GV?$ChTraitsCRT@G@ATL@@@ATL@@@ATL@@XZ) referenced in function "public: void __thiscall bluetoothCom::startAPI(void)" (?startAPI@bluetoothCom@@QAEXXZ)

Ren

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Link error Visual Studio 2005 with CwclServer
« Reply #4 on: May 08, 2013, 03:25:17 PM »
Send me your project to mike@btframework.com I'll check it out

rdesgagn

  • Guest
Re: Link error Visual Studio 2005 with CwclServer
« Reply #5 on: May 08, 2013, 04:21:40 PM »
Sent !

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Link error Visual Studio 2005 with CwclServer
« Reply #6 on: May 08, 2013, 08:37:12 PM »
Sorry but I have not recevied it.

rdesgagn

  • Guest
Re: Link error Visual Studio 2005 with CwclServer
« Reply #7 on: May 08, 2013, 09:49:23 PM »
Ok let's try another time.

Ren

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Link error Visual Studio 2005 with CwclServer
« Reply #8 on: May 09, 2013, 06:20:00 AM »
Received and checked

Option "Treat wchar_t as Built-in Type" must be Yes.

rdesgagn

  • Guest
Re: Link error Visual Studio 2005 with CwclServer
« Reply #9 on: May 09, 2013, 02:45:48 PM »
 Hi Mike,

It's compiling at least, will try to execute later today.

Thanks again !

Ren

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Link error Visual Studio 2005 with CwclServer
« Reply #10 on: May 09, 2013, 08:20:01 PM »
You are welcome.

 

Sitemap 1 2 3 4 5 6 7