1

I am trying to compile an existing code base developed with VS 2010 with VS 2013. The old implementation was using Boost 1.46 which does not support VS 2013. Therefore I upgraded to Boost 1.60.

I got stuck with the following part of a method:

int RS232CommunicationModule::initialize(apr_byte_t * path, apr_byte_t * data)
{
    std::vector<std::string> conf;
    std::string in_conf((char *) data);
    boost::split(conf, in_conf, boost::is_any_of(":"));
    // ...
}

Using Boost 1.46 and VS 2010 this builds without any issues. Opening the same project in VS 2013, changing the Boost reference to 1.60 and trying to build, I get a bunch of linker errors (LNK2019):

RS232CommunicationModule.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Vector_alloc<0,struct std::_Vec_base_types<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >::_Vector_alloc<0,struct std::_Vec_base_types<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >(class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > const &)" (__imp_??0?$_Vector_alloc@$0A@U?$_Vec_base_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@std@@QAE@ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z) referenced in function "public: __thiscall std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > ><class boost::iterators::transform_iterator<struct boost::algorithm::detail::copy_iterator_rangeF<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::_String_iterator<class std::_String_val<struct std::_Simple_types<char> > > >,class boost::algorithm::split_iterator<class std::_String_iterator<class std::_String_val<struct std::_Simple_types<char> > > >,struct boost::iterators::use_default,struct boost::iterators::use_default>,void>(class boost::iterators::transform_iterator<struct boost::algorithm::detail::copy_iterator_rangeF<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::_String_iterator<class std::_String_val<struct std::_Simple_types<char> > > >,class boost::algorithm::split_iterator<class std::_String_iterator<class std::_String_val<struct std::_Simple_types<char> > > >,struct boost::iterators::use_default,struct boost::iterators::use_default>,class boost::iterators::transform_iterator<struct boost::algorithm::detail::copy_iterator_rangeF<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::_String_iterator<class std::_String_val<struct std::_Simple_types<char> > > >,class boost::algorithm::split_iterator<class std::_String_iterator<class std::_String_val<struct std::_Simple_types<char> > > >,struct boost::iterators::use_default,struct boost::iterators::use_default>)" (??$?0V?$transform_iterator@U?$copy_iterator_rangeF@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$_String_iterator@V?$_String_val@U?$_Simple_types@D@std@@@std@@@2@@detail@algorithm@boost@@V?$split_iterator@V?$_String_iterator@V?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@@34@Uuse_default@iterators@4@U674@@iterators@boost@@X@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@V?$transform_iterator@U?$copy_iterator_rangeF@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$_String_iterator@V?$_String_val@U?$_Simple_types@D@std@@@std@@@2@@detail@algorithm@boost@@V?$split_iterator@V?$_String_iterator@V?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@@34@Uuse_default@iterators@4@U674@@iterators@boost@@0@Z)
RS232CommunicationModule.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Vector_alloc<0,struct std::_Vec_base_types<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >::~_Vector_alloc<0,struct std::_Vec_base_types<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >(void)" (__imp_??1?$_Vector_alloc@$0A@U?$_Vec_base_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@std@@QAE@XZ) referenced in function __unwindfunclet$??$?0V?$transform_iterator@U?$copy_iterator_rangeF@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$_String_iterator@V?$_String_val@U?$_Simple_types@D@std@@@std@@@2@@detail@algorithm@boost@@V?$split_iterator@V?$_String_iterator@V?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@@34@Uuse_default@iterators@4@U674@@iterators@boost@@X@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@V?$transform_iterator@U?$copy_iterator_rangeF@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$_String_iterator@V?$_String_val@U?$_Simple_types@D@std@@@std@@@2@@detail@algorithm@boost@@V?$split_iterator@V?$_String_iterator@V?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@@34@Uuse_default@iterators@4@U674@@iterators@boost@@0@Z$2
RS232CommunicationModule.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct std::_Wrap_alloc<class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __thiscall std::_Vector_alloc<0,struct std::_Vec_base_types<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >::_Getal(void)const " (__imp_?_Getal@?$_Vector_alloc@$0A@U?$_Vec_base_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@std@@QBE?AU?$_Wrap_alloc@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@2@XZ) referenced in function "public: void __thiscall std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >::emplace_back<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &&)" (??$emplace_back@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAEX$$QAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z)

C:\Projects\Foo\Debug\plugin\RS232CommunicationModule.dll : fatal error LNK1120: 3 unresolved externals

Unfortunately, I am not fluent enough in C++ templating to "parse" this stuff and understand what it is trying to tell me. I hope someone could point me to the right direction.

Tadej Mali
  • 1,143
  • 8
  • 18
  • It looks like you need to do a clean / full rebuild. It could be you're compiling your cpps with incompatible compiler flags. (E.g. arch/linkage/debug/threading model of the runtime libraries) – sehe Apr 21 '16 at 09:22

0 Answers0