none
Linker Errors when Migrating from VC2005 to VC2012 RRS feed

  • Question

  • Hi,

    error LNK2019: unresolved external symbol "void __cdecl std::_Xbad_alloc(void)" (?_Xbad_alloc@std@@YAXXZ) referenced in function "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Copy(unsigned int,unsigned int)" (?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z)<o:p></o:p>

    error LNK2019: unresolved external symbol "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z) referenced in function "public: bool __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Grow(unsigned int,bool)" (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE_NI_N@Z)<o:p></o:p>

    error LNK2019: unresolved external symbol "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z) referenced in function "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(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,unsigned int)" (?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z)<o:p></o:p>

    error LNK2019: unresolved external symbol "char const * __cdecl std::_Syserror_map(int)" (?_Syserror_map@std@@YAPBDH@Z) referenced in function "public: virtual class std::error_condition __thiscall std::_System_error_category::default_error_condition(int)const " (?default_error_condition@_System_error_category@std@@UBE?AVerror_condition@2@H@Z)<o:p></o:p>

    error LNK2019: unresolved external symbol "char const * __cdecl std::_Winerror_map(int)" (?_Winerror_map@std@@YAPBDH@Z) referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::_System_error_category::message(int)const " (?message@_System_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z)

    I am getting Linker Errors when migrating from VC2005 to VC2012. Please provide the solution where it is going wrong.

    Thanks

    kiran.




    • Edited by UdKiran Thursday, September 5, 2013 8:42 AM
    Thursday, September 5, 2013 8:38 AM

Answers

  • Hi UdKiran,

    LNK2019:unresolved external symbol 'symbol' referenced in function 'function'

    I suggest you read this link: http://msdn.microsoft.com/en-us/library/vstudio/799kze2z(v=vs.120).aspx

    And check out following things:

    1) #include the correct header
    2) #define any requisite macros
    3) specify all additional .lib dependencies


    Sunny Cao
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Anna Cc Monday, September 16, 2013 5:45 AM
    Monday, September 9, 2013 12:09 PM

All replies

  • Hard to figure out without a project. can you upload the project to skydrive and share it with us. Linker errors happen when the linker doesn't find the code for a function in its list of libraries hence it complains about unresolved symbol.

    Blog: http://ntcoder.com/bab


    Posts are provided as is without warranties or guaranties.

    Thursday, September 5, 2013 2:38 PM
    Moderator
  • Hi UdKiran,

    LNK2019:unresolved external symbol 'symbol' referenced in function 'function'

    I suggest you read this link: http://msdn.microsoft.com/en-us/library/vstudio/799kze2z(v=vs.120).aspx

    And check out following things:

    1) #include the correct header
    2) #define any requisite macros
    3) specify all additional .lib dependencies


    Sunny Cao
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Anna Cc Monday, September 16, 2013 5:45 AM
    Monday, September 9, 2013 12:09 PM