How to ensure that you are building against STLport
I am using Visual C++ 2005 to build a couple of libraries and an executable. I include the STLport location in the Additional Include Path of the libraries and include the library in the input to linker for executable.
The library however seems to reffer to stl symbols (such as string) without the stl port namespace. This results in a linker error.
these are the relevant lines from the command line on the 2 libraries and executable:
/Od /I "..\Junctions\fo_fid_3rdParty\STLport-5.1.0\stlport"
/Od /I "..\Junctions\Includes\fo_fid_3rdParty\STLport-5.1.0\stlport"
/OUT:"..\ET_BUILD\vc8\Debug\bin\SFGWDealerwebFixAutorecD.exe" /INCREMENTAL:NO /NOLOGO
..\junctions\libs\fo_fid_3rdParty\STLport-5.1.0\lib\stlportstld_vc8.5.1.lib
Here is an example of an error. Error 7 error LNK2001: unresolved external symbol "public: virtual bool __thiscall Springfield::CClientFramework::ProviderRequest(class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &,class std::basic_string,class std::allocator > const &)" (?ProviderRequest@CClientFramework@Springfield@@UAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@开发者_如何学JAVAD@2@@std@@00@Z) FixAutorec.lib
This symbol Springfield::CClientFramework::ProviderRequest comes from a library ClientArchitecture.lib This is how dumpbin.exe displays this symbol: (public: virtual bool __thiscall Springfield::CClientFramework::ProviderRequest(class stlpd_std::basic_string,class stlpd_std::allocator > const &,class stlpd_std::basic_string,class stlpd_std::allocator > const &,class Springfield::IDataStoreNode const *))
Note that the symbol being looked for defines its strings std::basic_string. Whereas the destination defines symbols as stlpd_std::basic_string.
thanks
精彩评论