views:

35

answers:

2

I am getting a bunch of linking errors while trying to link the release version of an executable(debug version does not have the same issue). Comparing the command line for the link does not reveal any issues. there are broadly 2 types of errors neither of which I can get a handle on.

The first kind complains about a unresolved external symbol _declspec(dllimport) As an example: error LNK2019: unresolved external symbol "_declspec(dllimport) public: __thiscall stlpd_std::basic_string,class stlpd_std::allocator >::basic_string,class stlpd_std::allocator >(class stlpd_std::basic_string,class stlpd_std::allocator > const &)" (_imp??0?$basic_string@DV?$char_traits@D@stlpd_std@@V?$allocator@D@2@@stlpd_std@@QAE@ABV01@@Z) referenced in function "public: __thiscall Springfield::generic::runtime_error::runtime_error(class stlpd_std::basic_string,class stlpd_std::allocator > const &)" (??0runtime_error@generic@Springfield@@QAE@ABV?$basic_string@DV?$char_traits@D@stlpd_std@@V?$allocator@D@2@@stlpd_std@@@Z)

for a more human readable version(replacing all the strings): error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall string::basic_string,class stlpd_std::allocator >(class string const &)" (_imp??0?$basic_string@DV?$char_traits@D@stlpd_std@@V?$allocator@D@2@@stlpd_std@@QAE@ABV01@@Z) referenced in function "public: __thiscall Springfield::generic::runtime_error::runtime_error(class string const &)" (??0runtime_error@generic@Springfield@@QAE@ABV?$basic_string@DV?$char_traits@D@stlpd_std@@V?$allocator@D@2@@stlpd_std@@@Z

The sceond class of errors complains about unresolved external symbol __CrtDbgReportW

I hope I can get some kind of insight in dealing with this.

+1  A: 

From the errors it looks like you are not including the CRT as one of your linked libraries. Here is a link to the different CRT lib's offered in Visual Studio 2005. Choose the one which is most appropriate and make sure it's in the list of lib's to link against

JaredPar
Thanks for the suggestion will try it.
Pradyot
It turns out i had the _DEBUG preprocessor directive within visual studio.
Pradyot
+1  A: 

It looks like you're either including a file that's been built using the debug settings or you're mixing runtime libraries (DLL and static).

Timo Geusch
Thanks , much appreciated.
Pradyot