Welcome to MSDN Blogs Sign in | Join | Help

Test Embedded

Questions and discussion about Windows CE and testing all things embedded ...

Trouble building tux test with VS 2005

Here is a heads up from one of our Developer's Tools Devs, Marty Larson:

This is something I discovered yesterday, and thought you all might
appreciate a heads up. If you try to build tux tests with VS 2005, you'll
run into this problem.

The default build settings in VS 2005 do not match the settings that the OS
was built with. VS tries to be C++ compliant, and treats wchar_t as a native
type. The OS tries to be backward compatible, and turns off that behavior.


This is only a problem when a dll exports a C++ interface (like kato does).
You'll see the following errors:


error LNK2019: unresolved external symbol "__declspec(dllimport) public: int
__cdecl CKato::EndLevel(wchar_t const *,...)"
(__imp_?EndLevel@CKato@@QAAHPB_WZZ) referenced in function ShellProc
error LNK2019: unresolved external symbol "__declspec(dllimport) public: int
__cdecl CKato::BeginLevel(unsigned long,wchar_t const *,...)"
(__imp_?BeginLevel@CKato@@QAAHKPB_WZZ) referenced in function ShellProc
error LNK2019: unresolved external symbol "__declspec(dllimport) public: int
__cdecl CKato::Log(unsigned long,wchar_t const *,...)"
(__imp_?Log@CKato@@QAAHKPB_WZZ) referenced in function ShellProc

To fix this, go to Project --> Properties --> Configuration Properties -->
C/C++ --> Language, and set 'Treat wchar_t as Built-in Type' to No.


--
Marty Larson [MS]
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Posted by Don Gambrell

Published Thursday, March 16, 2006 12:02 PM by wceqalab

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Trouble building tux test with VS 2005 @ Tuesday, April 11, 2006 9:54 AM

i tried your solution it worked with the test DLL but when i tried using KATO from my dialog based application it resolved the error and generated new ones

error LNK2019: unresolved external symbol "public: __cdecl CWinApp::CWinApp(unsigned short const *)"
error LNK2001: unresolved external symbol "public: virtual class CDocument * __cdecl CWinApp::OpenDocumentFile(unsigned short const *)" (?OpenDocumentFile@CWinApp@@UAAPAVCDocument@@PBG@Z)
error LNK2001: unresolved external symbol "public: virtual int __cdecl CWinApp::DoMessageBox(unsigned short const *,unsigned int,unsigned int)" (?DoMessageBox@CWinApp@@UAAHPBGII@Z)
error LNK2019: unresolved external symbol "protected: void __cdecl CWinApp::SetRegistryKey(unsigned short const *)" (?SetRegistryKey@CWinApp@@IAAXPBG@Z)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl ATL::CStringT<unsigned short,class StrTraitMFC_DLL<unsigned short,class ATL::ChTraitsOS<unsigned short> > >::~CStringT<unsigned short,class StrTraitMFC_DLL<unsigned short,class ATL::ChTraitsOS<unsigned short> > >(void)" (__imp_??1?$CStringT@GV?$StrTraitMFC_DLL@GV?$ChTraitsOS@G@ATL@@@@@ATL@@QAA@XZ)

Hamdy

# solution for Error LNK 2001:unresolved external symbol "public" virtual class ATL::CTime_thiscall F6XInstrument::GetSatellite Time(void) @ Monday, May 29, 2006 6:20 AM

while upgrading my project from VC++ 6.0 to VS2005 I got LNK2001 error as
Error LNK 2001:unresolved external symbol "public" virtual class ATL::CTime_thiscall F6XInstrument::GetSatellite Time(void)
please send me the solution for this Linker error

kartik

# re: Trouble building tux test with VS 2005 @ Wednesday, May 31, 2006 2:02 PM

You can use undname.exe to decode these mangled names. When you do
> that, you'll see:
>
> ?Log@CKato@@QAAHKPB_WZZ --> CKato::Log(unsigned long,wchar_t const
> *,...) and ?Log@CKato@@QAAHKPBGZZ --> CKato::Log(unsigned
> long,unsigned short const
> *,...)
>
> Back in the original post I mentioned that the problem was that the
> new compilers treat wchar's as native types, and you see that
> reflected in the function signatures. The build settings used for
> building kato treat wchar as unsigned short, and exported it that way.
> The build settings used by default in VS treat it as a native type, and expect to import it that way.
> The mismatch is causing the problem.
>
> So, the workaround here simply creates a dll that exports the function
> signature with wchar as a native type (expected by VS), and forwards
> it on to the same function in kato.dll that exports as unsigned short.
>
> --
> Marty Larson [MS]
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>

wceqalab

# re: Trouble building tux test with VS 2005 @ Friday, June 23, 2006 5:46 AM

hey !

I think i have a solution to ur problem!
Go to project setting-> C/C++ ->language and change "Tream WChar_t as inbuild type" to NO.

Thats all

hope that helps

sachin s

Leave a Comment

(required) 
required 
(required) 
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker