Skip to main content
GameDev.net gamedev.net
🔒 Locked 🤖 Godot

STL link error

Started by Sorairo Nov 6, 2004 at 1:18 PM 1 replies 600+ views
Original Post
Sorairo
Sorairo
I'm using Visual C++ .NET and created a standard solution for a DX7 project. I've enabled "Ignore all default libraries" so that I know exactly what's being included and from where. These are the libs I'm including for the Debug configuration: dxguid.lib ddraw.lib d3dim.lib d3dxd.lib comctl32.lib winmm.lib libcd.lib Anyway, regardless of the APIs I'm using, everything has been linking and running fine until I introduced STL into the mix. I'm only using the default vector template included with the .NET installation and am getting the following 2 link errors: 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,class std::allocator > & __thiscall std::basic_string,class std::allocator >::assign(class std::basic_string,class std::allocator > const &,unsigned int,unsigned int)" (?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z) 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,class std::allocator >::_Grow(unsigned int,bool)" (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NI_N@Z) The official STL site confirms that no extra libs are required to use STL (they're just templates after all), so I figure that's not the problem. Any ideas on what the problem might be? Thanks
SiCrane
SiCrane
STL implementations are free to use support functions that would be found in separate libraries. In the case of the default STL implementation shipped with MSVC .NET, the standard C++ library is split into both the template implementations in the headers as well as core support routines that are part of a linked library. The correct standard C++ library files for the various code generation options are:

LIBCP.LIB : /ML
LIBCPMT.LIB : /MT
MSVCPRT.LIB : /MD
LIBCPD.LIB : /MLd
LIBCPMTD.LIB : /MTd
MSVCPRTD.LIB : /MDd
Sorairo
Sorairo
Awesome, I had only linked the standard C lib - thanks SiCrane.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.