none
error LNK2001: unresolved external symbol

    Question

  • Hi,i have created one project in VS2010 and library paths($(ADTF2_DIR)\lib;$(QTDIR)\lib) given in linker->general->additionl library directories.

    when i try to buid the projet  i m getting the below errors

    adtfutilD_1100.lib(statistics.obj) : 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> >(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)
    1>adtfutilD_1100.lib(datetime.obj) : 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> >(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)
    1>adtfucomD_190.lib(exception.obj) : 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> >(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)
    1>adtfutilD_1100.lib(string.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> >(unsigned int,char)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ID@Z) referenced in function "public: __thiscall adtf_util::cString::cString(char)" (??0cString@adtf_util@@QAE@D@Z)
    1>adtfucomD_190.lib(ucom_error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::clear(void)" (__imp_?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ)
    1>adtfutilD_1100.lib(dom.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::clear(void)" (__imp_?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ)
    1>adtfutilD_1100.lib(parserhelper.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::clear(void)" (__imp_?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ)
    1>adtfutilD_1100.lib(string.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::clear(void)" (__imp_?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ) referenced in function "public: void __thiscall adtf_util::cString::Clear(void)" (?Clear@cString@adtf_util@@QAEXXZ)
    1>adtfutilD_1100.lib(statistics.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::clear(void)" (__imp_?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ)
    1>adtfutilD_1100.lib(filename.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::clear(void)" (__imp_?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ)
    1>adtfucomD_190.lib(object_identifier.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::clear(void)" (__imp_?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ)
    1>adtfutilD_1100.lib(string.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::assign(unsigned int,char)" (__imp_?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z) referenced in function "public: class adtf_util::cString & __thiscall adtf_util::cString::Set(char,int)" (?Set@cString@adtf_util@@QAEAAV12@DH@Z)
    1>adtfutilD_1100.lib(dom.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::assign(unsigned int,char)" (__imp_?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z)
    1>adtfutilD_1100.lib(pcrecpp.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::length(void)const " (__imp_?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) referenced in function "public: int __thiscall pcrecpp::RE::GlobalReplace(class pcrecpp::StringPiece const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)const " (?GlobalReplace@RE@pcrecpp@@QBEHABVStringPiece@2@PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
    1>adtfutilD_1100.lib(string.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::length(void)const " (__imp_?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ)
    1>adtfutilD_1100.lib(filename.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::length(void)const " (__imp_?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ)
    1>adtfucomD_190.lib(object_identifier.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::length(void)const " (__imp_?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ)
    1>adtfutilD_1100.lib(dom.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::length(void)const " (__imp_?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ)
    1>adtfutilD_1100.lib(string.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::resize(unsigned int)" (__imp_?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z) referenced in function "public: bool __thiscall adtf_util::cString::SetBuffer(int)" (?SetBuffer@cString@adtf_util@@QAE_NH@Z)

    how to resolve these errors?

    Thanks in advance

    Tuesday, March 06, 2012 2:05 PM

Answers

  • You are missing a bunch of std::string stuff.  That's all in the default libraries.  Are you ignoring the default libraries?

    I see that they are __declspec(dllimport) versions, so you are referring to the DLL versions of the runtime.  Did you accidentally compile something else against the static library versions of the runtime?

    Check that all your compiler settings refer to the same runtime libraries.  Probably everything should be Debug Multithreaded DLL in debug mode and Multithreaded DLL in release mode.

    • Proposed as answer by Helen Zhao Friday, March 09, 2012 8:12 AM
    • Marked as answer by Helen Zhao Tuesday, March 13, 2012 7:11 AM
    Wednesday, March 07, 2012 1:10 AM

All replies

  • You are missing a bunch of std::string stuff.  That's all in the default libraries.  Are you ignoring the default libraries?

    I see that they are __declspec(dllimport) versions, so you are referring to the DLL versions of the runtime.  Did you accidentally compile something else against the static library versions of the runtime?

    Check that all your compiler settings refer to the same runtime libraries.  Probably everything should be Debug Multithreaded DLL in debug mode and Multithreaded DLL in release mode.

    • Proposed as answer by Helen Zhao Friday, March 09, 2012 8:12 AM
    • Marked as answer by Helen Zhao Tuesday, March 13, 2012 7:11 AM
    Wednesday, March 07, 2012 1:10 AM
  • Hi,

    include some .lib files which supprots your application

    • Proposed as answer by aradhya,aru Friday, March 30, 2012 5:31 AM
    Friday, March 30, 2012 5:30 AM
  • Hello,

            I am facing same problem to build .exe 

    but I am solve this problem using following procedure :- 

    1) Copy this solution on another coloun

    2) Copy paste used dll, library in my project

    3) Go to Build -> Configuration Manager Set Configuration to 

    4) Project -> CreditModel Properties

    Set VC ++ Directory : Set Path of lib/Header file in following Option :-

    Include Directories C:\TreppCode\trepp-4.28.5-windows-vs2010-32bit;$(IncludePath)
    Reference Directories C:\TreppCode\trepp-4.28.5-windows-vs2010-32bit;$(IncludePath)
    Library Directories C:\TreppCode\trepp-4.28.5-windows-vs2010-32bit;$(IncludePath)

    C/C++ : Set Path of lib/Header file in following Option :-

    Additional Include Directories   C:\TreppCode\trepp-4.28.5-windows-vs2010-32bit;$(IncludePath)

    Linker : Set Path of lib/Header file in following Option :-

    Additional Library Directories   C:\TreppCode\trepp-4.28.5-windows-vs2010-32bit;$(IncludePath)

    I think your problem should be solve using above procedure.


    Tuesday, August 14, 2012 6:46 AM