none
Link error 2001:unresolved external symbol

    Question

  • I'm using a these libraries DragonFireSDK.lib(from DragonFireSDK - compatible with visual studio and visual studio Express using C++) and sqlite3.lib in my project.

    I built the sqlite3.lib in visual studio 2008 and i got the DragonFireSDK.lib file from the SDK team. I linked the sqlite3.lib in my project by following this link http://www.youtube.com/watch?v=BfVP7G4DJkM. When i use only the sqlite3.lib, i'm not getting any link errors. But when i use both the above libraries i get the linking errors. In the first stage i got the following errors,

     

     

    1>------ Build started: Project: iphoneApp, Configuration: Debug Win32 ------

    1>  sqlite3.lib(sqlite3.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance

    1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification

    1>LIBCMT.lib(_file.obj) : error LNK2005: __lock_file already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(_file.obj) : error LNK2005: __unlock_file already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj)

    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj)

    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj)

    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj)

    1>LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LIBCMT.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in MSVCRTD.lib(crtexe.obj)

    1>LIBCMT.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRTD.lib(MSVCR100D.dll)

    1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library

    1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

    1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

    1>MSVCRTD.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main

    1>LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main

    1>c:\users\priya\documents\visual studio 2010\Projects\iphoneApp\Debug\iphoneApp.exe : fatal error LNK1120: 1 unresolved externals

    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    I cleared this error by ignoring the default libraries.
    But now i get the following error
    1>------ Build started: Project: iphoneApp, Configuration: Debug Win32 ------
    1>  sqlite3.lib(sqlite3.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
    1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::ios_base::setf(int)" (__imp_?setf@ios_base@std@@QAEHH@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __int64 __thiscall std::ios_base::width(__int64)" (__imp_?width@ios_base@std@@QAE_J_J@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "int __cdecl FileOpen(char *)" (?FileOpen@@YAHPAD@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "int __cdecl FileCreate(char *)" (?FileCreate@@YAHPAD@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > std::cout" (__imp_?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__exit
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > & (__cdecl*)(class std::basic_ostream<char,struct std::char_traits<char> > &))" (__imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > std::cerr" (__imp_?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" (__imp_?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol ___security_cookie
    1>iphoneApp.obj : error LNK2001: unresolved external symbol ___CxxFrameHandler3
    1>iphoneApp.obj : error LNK2001: unresolved external symbol @__security_check_cookie@4
    1>sqlite3.lib(sqlite3.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
    1>iphoneApp.obj : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __RTC_CheckEsp
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __RTC_Shutdown
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __RTC_InitBase
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" (__imp_??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall std::basic_ostream<char,struct std::char_traits<char> >::~basic_ostream<char,struct std::char_traits<char> >(void)" (__imp_??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::basic_ostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (__imp_??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: __thiscall std::basic_ios<char,struct std::char_traits<char> >::basic_ios<char,struct std::char_traits<char> >(void)" (__imp_??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::clear(int,bool)" (__imp_?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (__imp_?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::~basic_streambuf<char,struct std::char_traits<char> >(void)" (__imp_??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "protected: virtual __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::showmanyc(void)" (?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE_JXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "protected: virtual __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::xsgetn(char *,__int64)" (?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE_JPAD_J@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "protected: virtual __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::xsputn(char const *,__int64)" (?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE_JPBD_J@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp___lock_file
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp___unlock_file
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__fwrite
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::codecvt<char,char,int>::out(int &,char const *,char const *,char const * &,char *,char *,char * &)const " (__imp_?out@?$codecvt@DDH@std@@QBEHAAHPBD1AAPBDPAD3AAPAD@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Pninc(void)" (__imp_?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::epptr(void)const " (__imp_?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::pptr(void)const " (__imp_?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__fputc
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Gndec(void)" (__imp_?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::eback(void)const " (__imp_?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::gptr(void)const " (__imp_?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__ungetc
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::egptr(void)const " (__imp_?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__memcpy_s
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::codecvt<char,char,int>::in(int &,char const *,char const *,char const * &,char *,char *,char * &)const " (__imp_?in@?$codecvt@DDH@std@@QBEHAAHPBD1AAPBDPAD3AAPAD@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__fgetc
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Gninc(void)" (__imp_?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) __int64 const std::_BADOFF" (__imp_?_BADOFF@std@@3_JB)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__fgetpos
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp___fseeki64
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__fsetpos
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__setvbuf
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__fflush
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Lockit::~_Lockit(void)" (__imp_??1_Lockit@std@@QAE@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Lockit::_Lockit(int)" (__imp_??0_Lockit@std@@QAE@H@Z)
    1>iphoneApp.obj : error LNK2001: 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)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__memmove
    1>sqlite3.lib(sqlite3.obj) : error LNK2001: unresolved external symbol __imp__memmove
    1>iphoneApp.obj : error LNK2001: unresolved external symbol _memcpy
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base12::~_Container_base12(void)" (__imp_??1_Container_base12@std@@QAE@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base12::_Container_base12(void)" (__imp_??0_Container_base12@std@@QAE@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base12::_Orphan_all(void)" (__imp_?_Orphan_all@_Container_base12@std@@QAEXXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::basic_streambuf<char,struct std::char_traits<char> >(void)" (__imp_??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::locale __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::getloc(void)const " (__imp_?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct _iobuf * __cdecl std::_Fiopen(char const *,int,int)" (__imp_?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::locale::facet * __thiscall std::locale::facet::_Decref(void)" (__imp_?_Decref@facet@locale@std@@QAEPAV123@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__fclose
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Init(char * *,char * *,int *,char * *,char * *,int *)" (__imp_?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Init(void)" (__imp_?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::codecvt<char,char,int>::unshift(int &,char *,char *,char * &)const " (__imp_?unshift@?$codecvt@DDH@std@@QBEHAAHPAD1AAPAD@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall std::codecvt_base::always_noconv(void)const " (__imp_?always_noconv@codecvt_base@std@@QBE_NXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::setg(char *,char *,char *)" (__imp_?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol _memset
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xlength_error(char const *)" (__imp_?_Xlength_error@std@@YAXPBD@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xout_of_range(char const *)" (__imp_?_Xout_of_range@std@@YAXPBD@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp___invalid_parameter
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp___CrtDbgReportW
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __CxxThrowException@8
    1>iphoneApp.obj : error LNK2001: unresolved external symbol __imp__free
    1>sqlite3.lib(sqlite3.obj) : error LNK2001: unresolved external symbol __imp__free
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,__int64)" (__imp_?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (__imp_?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const " (__imp_?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char __thiscall std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " (__imp_?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::ios_base::flags(void)const " (__imp_?flags@ios_base@std@@QBEHXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __int64 __thiscall std::ios_base::width(void)const " (__imp_?width@ios_base@std@@QBE_JXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol _strlen
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (__imp_?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " (__imp_?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall std::ios_base::good(void)const " (__imp_?good@ios_base@std@@QBE_NXZ)
    1>iphoneApp.obj : 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)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::uncaught_exception(void)" (__imp_?uncaught_exception@std@@YA_NXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::locale::facet::_Incref(void)" (__imp_?_Incref@facet@locale@std@@QAEXXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::bad_cast::bad_cast(char const *)" (__imp_??0bad_cast@std@@QAE@PBD@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned int __cdecl std::codecvt<char,char,int>::_Getcat(class std::locale::facet const * *,class std::locale const *)" (__imp_?_Getcat@?$codecvt@DDH@std@@SAIPAPBVfacet@locale@2@PBV42@@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::locale::id::operator unsigned int(void)" (__imp_??Bid@locale@std@@QAEIXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class std::locale::id std::codecvt<char,char,int>::id" (__imp_?id@?$codecvt@DDH@std@@2V0locale@2@A)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall std::bad_cast::~bad_cast(void)" (??1bad_cast@std@@UAE@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "public: __thiscall std::bad_cast::bad_cast(class std::bad_cast const &)" (??0bad_cast@std@@QAE@ABV01@@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)" (?_Facet_Register@facet@locale@std@@CAXPAV123@@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (__imp_?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::exception::exception(char const * const &)" (__imp_??0exception@std@@QAE@ABQBD@Z)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall std::exception::what(void)const " (?what@exception@std@@UBEPBDXZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall std::exception::~exception(void)" (__imp_??1exception@std@@UAE@XZ)
    1>iphoneApp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::exception::exception(class std::exception const &)" (__imp_??0exception@std@@QAE@ABV01@@Z)
    1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
    1>sqlite3.lib(sqlite3.obj) : error LNK2001: unresolved external symbol __imp__strncmp
    1>sqlite3.lib(sqlite3.obj) : error LNK2001: unresolved external symbol __imp__malloc
    1>sqlite3.lib(sqlite3.obj) : error LNK2001: unresolved external symbol __imp___localtime64_s
    1>sqlite3.lib(sqlite3.obj) : error LNK2001: unresolved external symbol __imp__realloc
    1>c:\users\priya\documents\visual studio 2010\Projects\iphoneApp\Debug\iphoneApp.exe : fatal error LNK1120: 108 unresolved externals
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    need help to resolve this.
    Thanks in advance!

     

     



    • Edited by ayirp Wednesday, January 04, 2012 6:23 AM
    Wednesday, January 04, 2012 6:08 AM

Answers

All replies

  • This happens when the exe/libs use different C/C++ runtime libraries.

    Ensure that the libraries and the exe are in sync (Project properties | C/C++ | Code Generation | Runtime Library).


    --Jag
    Wednesday, January 04, 2012 6:45 AM
  • @jag

    I'm using /MT for release and /MTd for debug.

    Now, after ignoring /NODEFAULTLIB:LIBCMT, i'm getting the following error

     

    1>Linking...

    1>Sqlite3.lib(sqlite3.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance

    1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification

    1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

    1>LIBCMTD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main

    1>C:\Users\priya\Documents\Visual Studio 2008\Projects\SqliteTable\Debug\SqliteTable.exe : fatal error LNK1120: 1 unresolved externals

     

    Kindly help,

    Thanks!

     

    Wednesday, January 04, 2012 7:35 AM
  • I believe the DragonFireSDK is compiled with /MDd. You need to get it recompiled with /MTd. Alternatively, you can move your exe to be recompiled with /MDd

    More information about the different runtime libraries available can be found here

    http://msdn.microsoft.com/en-us/library/abx4dbyh(v=VS.100).aspx

     

    You are also mixing release and debug libraries (for example, using /NODEFAULTLIB:LIBCMT in debug configuration).


    --Jag
    Wednesday, January 04, 2012 1:30 PM