使用boost :: is_any_of导致链接器错误

时间:2016-04-21 07:06:44

标签: c++ templates boost visual-studio-2013 lnk2019

我正在尝试使用VS 2013编译使用VS 2010开发的现有代码库。 旧的实现使用的是Boost 1.46,它不支持VS 2013.因此我升级到Boost 1.60。

我遇到了方法的以下部分:

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(":"));
    // ...
}

使用Boost 1.46和VS 2010可以毫无问题地构建。在VS 2013中打开相同的项目,将Boost引用更改为1.60并尝试构建,我收到一堆链接器错误(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

不幸的是,我在C ++方面不够流利,不能“解析”这些东西并理解它试图告诉我的内容。我希望有人能指出我正确的方向。

0 个答案:

没有答案