For Programmers: Free Programming Magazines  


Home > Archive > VC STL > January 2006 > libcp.lib from PSDK version 3790.1830 incompatible with STL on VC++ 2003









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author libcp.lib from PSDK version 3790.1830 incompatible with STL on VC++ 2003
NowhereDifferentiable@gmail.com

2006-01-10, 7:24 pm

I'm not sure if this is a bug or a known incompatibility. I haven't
been able to find authoritative information via search engine. This
bit of info may provide some help to other wayward souls who are
running Visual C++ 2003 with the April 2005 SDK installed.

Microsoft C++ Compiler Version: 13.10.3077 for 80x86 (Visual Studio
..NET 2003)
Microsoft Incremental Linker Version: 7.10.3077 (Visual Studio .NET
2003)
Microsoft Platform SDK Version: 3790.1830 (April 2005)

In trying to compile some C++ code that uses an STL queue, I
encountered linker errors, which can be reproduced using the sample
code for queue.cpp in the Visual C++ help:

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/vcstdlib/html/vcsampSamplequeuefunctionsSTLSample.htm

http://msdn.microsoft.com/library/d...rarySamples.asp

When compiled as a Win32 Console Project under Release mode, the
program produces the following error messages:

queue.obj : error LNK2019: unresolved external symbol "public: void
__thiscall std::_String_base::_Xran(void)const "
(?_Xran@_String_base@std@@QBEXXZ) referenced in function "public: class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > & __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::erase(unsigned
int,unsigned int)"
(?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z)
queue.obj : error LNK2019: unresolved external symbol "public: void
__thiscall std::locale::facet::_Register(void)"
(?_Register@facet@locale@std@@QAEXXZ) referenced in function "class
std::num_put<char,class std::ostreambuf_iterator<char,struct
std::char_traits<char> > > const & __cdecl std::use_facet<class
std::num_put<char,class std::ostreambuf_iterator<char,struct
std::char_traits<char> > > >(class std::locale const &)"
(??$use_facet@V?$num_put@DV?$ostreambuf_iterator@DU? $char_traits@D@std@@@std@@@std@@@std@@YA
ABV?$num_put@DV?$ostreambuf_iterator@DU? $char_traits@D@std@@@std@@@0@ABVlocale@0
@@Z)
queue.obj : error LNK2019: unresolved external symbol "public: class
std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned
int)const " (? _Getfacet@locale@std@@QBEPBVfacet@12@I@Z
) referenced in
function "class std::num_put<char,class
std::ostreambuf_iterator<char,struct std::char_traits<char> > > const &
__cdecl std::use_facet<class std::num_put<char,class
std::ostreambuf_iterator<char,struct std::char_traits<char> > > >(class
std::locale const &)"
(??$use_facet@V?$num_put@DV?$ostreambuf_iterator@DU? $char_traits@D@std@@@std@@@std@@@std@@YA
ABV?$num_put@DV?$ostreambuf_iterator@DU? $char_traits@D@std@@@std@@@0@ABVlocale@0
@@Z)
queue.obj : error LNK2019: unresolved external symbol "public: void
__thiscall std::_String_base::_Xlen(void)const "
(?_Xlen@_String_base@std@@QBEXXZ) referenced in function "protected:
bool __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::_Grow(unsigned
int,bool)"
(?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NI_N@Z)

The problem is caused by attempting to link against the version of
libcp.lib in the latest Microsoft Platform SDK.

After adding the linker option /VERBOSE:LIB to the build, one can see
that the linker is picking up the SDK version of the library just prior
to the linker error message:

Searching C:\Program Files\Microsoft Platform SDK\lib\libcp.lib

If you do a DUMPBIN /ALL for libcp.lib in the SDK versus the one the
ships with Visual C++ .NET 2003, you'll find that the symbols are
decorated differently. For example, in the the case of _Xran():

VC++7: ?_Xran@_String_base@std@@QBEXXZ (public: void __thiscall
std::_String_base::_Xran(void)const )

PSDK: ?_Xran@std@@YAXXZ (void __cdecl std::_Xran(void))

Additionally, If one removes the copy of libcp.lib from the platform
SDK directory so that the linker does not find it, the linker finds the
Visual C++ .NET 2003 version and completes successfully. The sample
program executes as expected.

--
P.J. Hinton

Boris Kropivnitsky

2006-01-12, 7:09 pm

Same here, I am using free VC toolkit.

PSDK ships with the version of libcp.lib which conflicts with
headers/libs included in VC. Interestingly enough, no MT or debug
versions of this lib is shipped with PSDK (such as libcpd.lib or
libcpmt*.lib).

This clearly indicates a bug in PSDK distribution. I was unable to find
any info on this in KB either.

Apart from deleting the library from PSDK directory, this can be worked
around by compiling/linking against MT version of the library, i.e.
using /MT switch. Either way, it can get quite annoying when one has
large code base affected, and/or many machines involved in the builds.

Cheers,
Boris Kropivnitsky


NowhereDifferentiable@gmail.com wrote:
> I'm not sure if this is a bug or a known incompatibility. I haven't
> been able to find authoritative information via search engine. This
> bit of info may provide some help to other wayward souls who are
> running Visual C++ 2003 with the April 2005 SDK installed.
>
> Microsoft C++ Compiler Version: 13.10.3077 for 80x86 (Visual Studio
> .NET 2003)
> Microsoft Incremental Linker Version: 7.10.3077 (Visual Studio .NET
> 2003)
> Microsoft Platform SDK Version: 3790.1830 (April 2005)
>
> In trying to compile some C++ code that uses an STL queue, I
> encountered linker errors, which can be reproduced using the sample
> code for queue.cpp in the Visual C++ help:
>
> ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/vcstdlib/html/vcsampSamplequeuefunctionsSTLSample.htm
>
> http://msdn.microsoft.com/library/d...rarySamples.asp
>
> When compiled as a Win32 Console Project under Release mode, the
> program produces the following error messages:
>
> queue.obj : error LNK2019: unresolved external symbol "public: void
> __thiscall std::_String_base::_Xran(void)const "
> (?_Xran@_String_base@std@@QBEXXZ) referenced in function "public: class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > & __thiscall std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> >::erase(unsigned
> int,unsigned int)"
> (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z)
> queue.obj : error LNK2019: unresolved external symbol "public: void
> __thiscall std::locale::facet::_Register(void)"
> (?_Register@facet@locale@std@@QAEXXZ) referenced in function "class
> std::num_put<char,class std::ostreambuf_iterator<char,struct
> std::char_traits<char> > > const & __cdecl std::use_facet<class
> std::num_put<char,class std::ostreambuf_iterator<char,struct
> std::char_traits<char> > > >(class std::locale const &)"
> (??$use_facet@V?$num_put@DV?$ostreambuf_iterator@DU? $char_traits@D@std@@@std@@@std@@@std@@YA
ABV?$num_put@DV?$ostreambuf_iterator@DU? $char_traits@D@std@@@std@@@0@ABVlocale@0
@@Z)
> queue.obj : error LNK2019: unresolved external symbol "public: class
> std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned
> int)const " (? _Getfacet@locale@std@@QBEPBVfacet@12@I@Z
) referenced in
> function "class std::num_put<char,class
> std::ostreambuf_iterator<char,struct std::char_traits<char> > > const &
> __cdecl std::use_facet<class std::num_put<char,class
> std::ostreambuf_iterator<char,struct std::char_traits<char> > > >(class
> std::locale const &)"
> (??$use_facet@V?$num_put@DV?$ostreambuf_iterator@DU? $char_traits@D@std@@@std@@@std@@@std@@YA
ABV?$num_put@DV?$ostreambuf_iterator@DU? $char_traits@D@std@@@std@@@0@ABVlocale@0
@@Z)
> queue.obj : error LNK2019: unresolved external symbol "public: void
> __thiscall std::_String_base::_Xlen(void)const "
> (?_Xlen@_String_base@std@@QBEXXZ) referenced in function "protected:
> bool __thiscall std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> >::_Grow(unsigned
> int,bool)"
> (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NI_N@Z)
>
> The problem is caused by attempting to link against the version of
> libcp.lib in the latest Microsoft Platform SDK.
>
> After adding the linker option /VERBOSE:LIB to the build, one can see
> that the linker is picking up the SDK version of the library just prior
> to the linker error message:
>
> Searching C:\Program Files\Microsoft Platform SDK\lib\libcp.lib
>
> If you do a DUMPBIN /ALL for libcp.lib in the SDK versus the one the
> ships with Visual C++ .NET 2003, you'll find that the symbols are
> decorated differently. For example, in the the case of _Xran():
>
> VC++7: ?_Xran@_String_base@std@@QBEXXZ (public: void __thiscall
> std::_String_base::_Xran(void)const )
>
> PSDK: ?_Xran@std@@YAXXZ (void __cdecl std::_Xran(void))
>
> Additionally, If one removes the copy of libcp.lib from the platform
> SDK directory so that the linker does not find it, the linker finds the
> Visual C++ .NET 2003 version and completes successfully. The sample
> program executes as expected.
>
> --
> P.J. Hinton


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com