agustin_m

Hello,

I have a project that was created/build using VC++ 6.0, the project uses a third party library iconnect.lib. I am trying to compile the project using VC++ 8.0 but I get a lot of linker errors - some of those errors are below. Note: the project compiles without errors or warnings when using VC++ 6.0.

Can someone tell me what I need to do to get my project to compile/link successfully with VC++ 8.0

Thanks in advance!

-Agustin

ERRORS:

Error 82 error LNK2001: unresolved external symbol __RTC_CheckEsp iconnect.lib
Error 83 error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl toAmountString(double)" ( toAmountString@@YA AV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@std@@N@Z) iconnect.lib
Error 164 error LNK2001: unresolved external symbol __RTC_CheckEsp SampleMsgHandler.obj
Error 165 error LNK2001: unresolved external symbol __RTC_Shutdown iconnect.lib
Error 168 error LNK2019: unresolved external symbol __RTC_Shutdown referenced in function "private: void __thiscall iConnect::iCTradeExtensionEuroRepo::_unpack_str2DealRefEuro(class iConnect::iCMessageBuffer &)" ( _unpack_str2DealRefEuro@iCTradeExtensionEuroRepo@iConnect@@AAEXAAViCMessageBuffer@2@@Z) iconnect.lib
Error 169 error LNK2001: unresolved external symbol __RTC_Shutdown iconnect.lib
Error 329 error LNK2001: unresolved external symbol __RTC_InitBase iconnect.lib
Error 411 error LNK2019: unresolved external symbol __RTC_InitBase referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl toAmountString(double)" ( toAmountString@@YA AV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@std@@N@Z) iconnect.lib
Error 412 error LNK2001: unresolved external symbol __RTC_InitBase iconnect.lib
Error 493 error LNK2001: unresolved external symbol ___security_cookie Simple.obj
Error 494 error LNK2019: unresolved external symbol ___security_cookie referenced in function "protected: virtual void __thiscall CSample::onConnect(class iConnect::iCSession &)" ( onConnect@CSample@@MAEXAAViCSession@iConnect@@@Z) Sample.obj
Error 495 error LNK2001: unresolved external symbol ___security_cookie SampleCommands.obj
Error 498 error LNK2001: unresolved external symbol ___CxxFrameHandler3 Simple.obj
Error 499 error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __ehhandler$ onConnect@CSample@@MAEXAAViCSession@iConnect@@@Z Sample.obj
Error 500 error LNK2001: unresolved external symbol ___CxxFrameHandler3 SampleCommands.obj
Error 503 error LNK2001: unresolved external symbol @__security_check_cookie@4 Simple.obj
Error 504 error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function __ehhandler$ onConnect@CSample@@MAEXAAViCSession@iConnect@@@Z Sample.obj
Error 505 error LNK2001: unresolved external symbol @__security_check_cookie@4 SampleCommands.obj
Error 508 error LNK2019: unresolved external symbol @_RTC_CheckStackVars@8 referenced in function "public: virtual void __thiscall iConnect::iCBankDetail::dump(class std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> > &)const " ( dump@iCBankDetail@iConnect@@UBEXAAV $basic_ostringstream@DU $char_traits@D@std@@V $allocator@D@2@@std@@@Z) iconnect.lib
Error 509 error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8 iconnect.lib
Error 650 error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8 Sample.obj
Error 651 error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8 SampleCommands.obj
Error 652 error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8 SampleLog.obj
Error 653 error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8 SampleMsgHandler.obj
Error 654 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (__imp_ _Osfx@ $basic_ostream@DU $char_traits@D@std@@@std@@QAEXXZ) referenced in function "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::sentry::~sentry(void)" ( 1sentry@ $basic_ostream@DU $char_traits@D@std@@@std@@QAE@XZ) Sample.obj
Error 655 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (__imp_ _Osfx@ $basic_ostream@DU $char_traits@D@std@@@std@@QAEXXZ) SampleCommands.obj
Error 656 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (__imp_ _Osfx@ $basic_ostream@DU $char_traits@D@std@@@std@@QAEXXZ) SampleLog.obj
Error 657 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (__imp_ _Osfx@ $basic_ostream@DU $char_traits@D@std@@@std@@QAEXXZ) SampleMsgHandler.obj
Error 658 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_ _Lock@ $basic_streambuf@DU $char_traits@D@std@@@std@@QAEXXZ) referenced in function "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Sentry_base::_Sentry_base(class std::basic_ostream<char,struct std::char_traits<char> > &)" ( 0_Sentry_base@ $basic_ostream@DU $char_traits@D@std@@@std@@QAE@AAV12@@Z) Sample.obj
Error 659 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_ _Lock@ $basic_streambuf@DU $char_traits@D@std@@@std@@QAEXXZ) SampleCommands.obj
Error 667 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (__imp_ 0 $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@std@@QAE@PBD@Z) iconnect.lib
Error 668 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (__imp_ 0 $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@std@@QAE@PBD@Z) iconnect.lib
Error 902 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *,unsigned int)" (__imp_ 0 $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@std@@QAE@PBDI@Z) referenced in function "public: class iConnect::iCMessageBuffer & __thiscall iConnect::iCMessageBuffer::operator>>(class iConnect::flstring &)" ( 5iCMessageBuffer@iConnect@@QAEAAV01@AAVflstring@1@@Z) iconnect.lib
Error 903 error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function "public: int __thiscall iConnect::WSALib::init(void)" ( init@WSALib@iConnect@@QAEHXZ) iconnect.lib
Error 904 error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function "public: int __thiscall iConnect::WSALib::fini(void)" ( fini@WSALib@iConnect@@QAEHXZ) iconnect.lib




Re: Visual C++ General Using VC++ 8.0

nobugz

Not a CLR question, moved to C++ General.





Re: Visual C++ General Using VC++ 8.0

Sarath.

Seems your library is linking with another one

for e.g iconnect.lib might be built using some other thirdparty libraries like STLPort, boost etc...

I doubts, it is STLPort.Please verify it and if you missed something in Visual C++ 8.0 Linking options, please do add it, also please verify the order of Include Directories in your VS 2005 IDE with VS 98.





Re: Visual C++ General Using VC++ 8.0

agustin_m

Sarath,

Thanks for your reply!

I don't think the iconnect.lib was build using a third party library...note that the project compiles and links under VS 98. I have posted the include directories for

VS 2005 and VS 98, also the linker command line for the VS 2005 project...

Look at the linker ERRORS and observe that the errors are cause by the basic_string class...

Any help with this issue will be greatly appreciated!

-Agustin

VS 2005 Include Directories:

$(VCInstallDir)include

$(VCInstallDir)atlmfc\include

$(VCInstallDir)PlatformSDK\include

$(FrameworkSDKDir)include

VS 98 Include Directories:

C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE

C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE

C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE

Linker Command Line:

/OUT:".\Release/Simple_cpp.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"../../win_extern/lib" /MANIFEST /MANIFESTFILE:".\Release/Temp\Simple_cpp.exe.intermediate.manifest" /PDB:".\Release/Simple_cpp.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:PROMPT ../../lib/iconnect.lib ../../win_extern/lib/pthreadVC.lib ws2_32.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

ERRORS:

Error 3 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 4 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 5 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 6 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 7 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 8 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 9 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 10 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 11 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 12 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 13 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 14 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 15 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 16 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 17 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 18 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 19 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 20 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 21 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib
Error 22 error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ( 6std@@YAAAV $basic_ostream@DU $char_traits@D@std@@@0@AAV10@ABV $basic_string@DU $char_traits@D@std@@V $allocator@D@2@@0@@Z) iconnect.lib






Re: Visual C++ General Using VC++ 8.0

nobugz

The signatures of the basic_ostream class members have changed between VS6 and VS8. I think it is the calling convention, (__cdecl to __clrcall), not sure. You'll need to rebuild iconnect.lib





Re: Visual C++ General Using VC++ 8.0

agustin_m

I don't have the source code for iconnect.lib. Also I am compiling the project with No Common Language Runtime support

Thanks for any help you can provide me!

-Agustin






Re: Visual C++ General Using VC++ 8.0

matt_92707

You aren't linking with a C library. Almost all the errors are related to that. There's a few errors in there related to not linking in WSOCK32.LIB as well.

Since you didn't specify I'm going to assume you are using the Visual C++ 2005 Express IDE. I don't think this IDE includes WSOCK32.LIB, so make sure you have installed the Platform SDK from Microsoft (its free too) so you will have it. If you download it at the Visual C++ 2005 Express web page then there's instructions to tell you how to properly install it as well. Follow the installation instructions. Professional versions of Visual C++ 2005 should come with WSOCK32.LIB included.

To fix your project configuration, go into the Project Options to Linker->Input and turn off the option that says "Ignore All Default Libraries" then add wsock32.lib to Additional Dependencies. Make sure you dont have /NODEFAULTLIB added manually under Linker->Command Line->Additional Options also. If you enabled that option on purpose because you got an MSVCRT missing error then you need to go into Tools->Options->Projects and Solutions->VC++ Directories->Library Files and add "$(VCInstallDir)lib" so that the compiler will know where its libraries are. Make sure there's an entry there for the lib folder from the Platform SDK as well.





Re: Visual C++ General Using VC++ 8.0

agustin_m

Matt,

I am using VS 2005 Professional! I follow your instructions and still get the same erros...any other suggestion

Thanks,