By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,905 Members | 1,265 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,905 IT Pros & Developers. It's quick & easy.

Linking static libraries from different MSVC compilers

P: 1
Hello All,
I have some static libraries generated on MSVC 2005 express edition and I have to use them along with static libraries created with MSVC 2003 and create an application on MSVC2003.

example.lib - generated on MSVC2005
All other libs - generated on MSVC2003

I have attached the compiler options as well as the error log along.
Any tips/suggestions will be of great help.

Thanks in Advance
Rahul

Compiler Options

Od /I "D:\trial\adl\\" /I "D:\trial\adl\../boost-RC_1_34_0-07-02-13-1710" /D "WIN32" /D "_DEBUG" /D "_LIB" /D "_CONSOLE" /D "USE_BOOST_TYPEOF" /D "USE_NO_GCC_BUILTINS" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /MD /Fo"Debug/" /Fd"Debug/vc70.pdb" /W0 /c /Wp64 /Zi /TP
.\driver2.cc
]
Creating command line "cl.exe @d:\trial\StandAlone\Debug\RSP0000EB.rsp /nologo"
Creating temporary file "d:\trial\StandAlone\Debug\RSP0000EC.rsp" with contents
[
/OUT:"D:\trial\adl\..\Debug/StandAlone.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib" /LIBPATH:"D:\trial\adl\..\Debug" /NODEFAULTLIB /DEBUG /PDB:"D:\trial\adl\..\Debug/StandAlone.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 /FORCE /VERBOSE


msvcrtd.lib msvcprtd.lib libcpmtd.lib example.lib AdlIssExec.lib AdlIssMain.lib AdlIssSupport.lib AdlIssLogging.lib AdlIssTransLogging.lib AdlParsing.lib AdlSupport.lib IntbvRnum.lib Intbv.lib gc.lib RNumber.lib sim-util.lib Sfpu.lib SfpuAdl.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 "\trial\debug\sim-util.lib"
.\Debug\driver2.obj


Error Messages
example.lib(example.obj) : error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __ehhandler$?getAttrData@adliss@@YAABUAttrData@adl @@XZ
example.lib(example.obj) : error LNK2001: unresolved external symbol "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z)
example.lib(example.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall std::exception::~exception(void)" (__imp_??1exception@std@@UAE@XZ) referenced in function __unwindfunclet$??0runtime_error@std@@QAE@ABV?$bas ic_string@DU?$char_traits@D@std@@V?$allocator@D@2@ @1@@Z$0
example.lib(example.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::exception::exception(void)" (__imp_??0exception@std@@QAE@XZ) referenced in function "public: __thiscall std::runtime_error::runtime_error(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0runtime_error@std@@QAE@ABV?$basic_string@DU?$c har_traits@D@std@@V?$allocator@D@2@@1@@Z)
example.lib(example.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::exception::exception(class std::exception const &)" (__imp_??0exception@std@@QAE@ABV01@@Z) referenced in function "public: __thiscall std::runtime_error::runtime_error(class std::runtime_error const &)" (??0runtime_error@std@@QAE@ABV01@@Z)
example.lib(example.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (__imp_?_Debug_message@std@@YAXPB_W0I@Z) referenced in function "public: void __thiscall std::_Iterator_base::_Orphan_me(void)" (?_Orphan_me@_Iterator_base@std@@QAEXXZ)
example.lib(example.obj) : error LNK2019: unresolved external symbol __imp___wassert referenced in function "public: unsigned int __thiscall adliss:Stick out tongueowerpc::L1_cache_get_set(unsigned int)const " (?L1_cache_get_set@powerpc@adliss@@QBEII@Z)
example.lib(example.obj) : 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> >(struct std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Has_debug_it)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V? $allocator@D@2@@std@@QAE@U_Has_debug_it@01@@Z) referenced in function "public: __thiscall adl::IntroBase::IntroBase(void)" (??0IntroBase@adl@@QAE@XZ)
example.lib(example.obj) : error LNK2019: unresolved external symbol __imp___invalid_parameter referenced in function "public: unsigned int const & __thiscall std::vector<unsigned int,class std::allocator<unsigned int> >:Surpriseperator[](unsigned int)const " (??A?$vector@IV?$allocator@I@std@@@std@@QBEABII@Z)
example.lib(example.obj) : error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced in function "public: unsigned int const & __thiscall std::vector<unsigned int,class std::allocator<unsigned int> >:Surpriseperator[](unsigned int)const " (??A?$vector@IV?$allocator@I@std@@@std@@QBEABII@Z)
example.lib(example.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ) referenced in function "public: __thiscall std::_Vector_val<int,class std::allocator<int> >::~_Vector_val<int,class std::allocator<int> >(void)" (??1?$_Vector_val@HV?$allocator@H@std@@@std@@QAE@X Z)
example.lib(example.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) referenced in function "protected: void __thiscall std::vector<int,class std::allocator<int> >::_Tidy(void)" (?_Tidy@?$vector@HV?$allocator@H@std@@@std@@IAEXXZ )
example.lib(example.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ) referenced in function "protected: __thiscall std::_Vector_val<int,class std::allocator<int> >::_Vector_val<int,class std::allocator<int> >(class std::allocator<int>)" (??0?$_Vector_val@HV?$allocator@H@std@@@std@@IAE@V ?$allocator@H@1@@Z)
example.lib(example.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::exception::exception(char const * const &)" (__imp_??0exception@std@@QAE@ABQBD@Z) referenced in function "public: __thiscall std::bad_alloc::bad_alloc(char const *)" (??0bad_alloc@std@@QAE@PBD@Z)
example.lib(example.obj) : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall std::exception::what(void)const " (?what@exception@std@@UBEPBDXZ)
example.lib(example.obj) : error LNK2019: unresolved external symbol __imp__memmove_s referenced in function "int * __cdecl std::_Uninit_copy<class std::_Vector_const_iterator<int,class std::allocator<int> >,int *,class std::allocator<int> >(class std::_Vector_const_iterator<int,class std::allocator<int> >,class std::_Vector_const_iterator<int,class std::allocator<int> >,int *,class std::allocator<int> &,struct std::_Scalar_ptr_iterator_tag,struct std::_Range_checked_iterator_tag)" (??$_Uninit_copy@V?$_Vector_const_iterator@HV?$all ocator@H@std@@@std@@PAHV?$allocator@H@2@@std@@YAPA HV?$_Vector_const_iterator@HV?$allocator@H@std@@@0 @0PAHAAV?$allocator@H@0@U_Scalar_ptr_iterator_tag@ 0@U_Range_checked_iterator_tag@0@@Z)
May 31 '07 #1
Share this Question
Share on Google+
3 Replies


Motoma
Expert 2.5K+
P: 3,235
I believe this is more of a C/C++ related issue, therefore I am moving this thread to the appropriate forum.
May 31 '07 #2

weaknessforcats
Expert Mod 5K+
P: 9,197
Are these missing functions in the library headers?
May 31 '07 #3

P: 1
That's due to /NODEFAULTLIB. Remove that flag and it should compile (at least it should have less undefined references).
Aug 22 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.