Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: rdesgagn on May 08, 2013, 12:21:26 AM

Title: Link error Visual Studio 2005 with CwclServer
Post by: rdesgagn 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
Title: Re: Link error Visual Studio 2005 with CwclServer
Post by: Mike Petrichenko on May 08, 2013, 06:15:38 AM
WCL uses UNICODE. Change your project options to use UNICODE instead of MuliByte.
Title: Re: Link error Visual Studio 2005 with CwclServer
Post by: rdesgagn 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
Title: Re: Link error Visual Studio 2005 with CwclServer
Post by: rdesgagn 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
Title: Re: Link error Visual Studio 2005 with CwclServer
Post by: Mike Petrichenko on May 08, 2013, 03:25:17 PM
Send me your project to mike@btframework.com I'll check it out
Title: Re: Link error Visual Studio 2005 with CwclServer
Post by: rdesgagn on May 08, 2013, 04:21:40 PM
Sent !
Title: Re: Link error Visual Studio 2005 with CwclServer
Post by: Mike Petrichenko on May 08, 2013, 08:37:12 PM
Sorry but I have not recevied it.
Title: Re: Link error Visual Studio 2005 with CwclServer
Post by: rdesgagn on May 08, 2013, 09:49:23 PM
Ok let's try another time.

Ren
Title: Re: Link error Visual Studio 2005 with CwclServer
Post by: Mike Petrichenko on May 09, 2013, 06:20:00 AM
Received and checked

Option "Treat wchar_t as Built-in Type" must be Yes.
Title: Re: Link error Visual Studio 2005 with CwclServer
Post by: rdesgagn on May 09, 2013, 02:45:48 PM
 Hi Mike,

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

Thanks again !

Ren
Title: Re: Link error Visual Studio 2005 with CwclServer
Post by: Mike Petrichenko on May 09, 2013, 08:20:01 PM
You are welcome.