我已经阅读了有关问题和Google的所有可能的相关答案,但仍然无济于事。如果有人能为我提供正确的解决方案,我将不胜感激。
我正在尝试使用stringstream进行序列化,但出现此编译错误。
代码段
std :: stringstream oss;
boost :: archive :: text_oarchive oa(oss); 注:如果删除了这一行,则可以编译。添加这一行,我遇到了如下所述的编译错误。
oa << cmd;
std :: string serialized_string(oss.str());
../../ target_cfg / libTargetConfig.so:对boost::archive::archive_exception::archive_exception(boost::archive::archive_exception const&)'
../../abc.so: undefined reference to
boost :: archive :: detail :: basic_oarchive ::〜basic_oarchive()的未定义引用
../../abc.so:对boost::archive::archive_exception::~archive_exception()'
../../abc.so: undefined reference to
boost :: archive :: archive_exception :: archive_exception(boost :: archive :: archive_exception :: exception_code,char const *,char const *)的未定义引用”)
../../abc.so:对boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::text_oarchive_impl(std::ostream&, unsigned int)'
../../abc.so: undefined reference to
boost :: archive :: basic_text_oarchive :: newtoken()的未定义引用
../../abc.so:对boost::archive::detail::basic_oarchive::end_preamble()'
../../abc.so: undefined reference to
boost :: archive :: basic_text_oprimitive ::〜basic_text_oprimitive()的未定义引用
../../abc.so:对typeinfo for boost::archive::archive_exception'
../../abc.so: undefined reference to
boost :: archive :: text_oarchive_impl :: save(std :: __ cxx11 :: basic_string,std :: allocator> const&)的未定义引用”
../../abc.so:对于boost :: archive :: detail :: basic_oarchive'的对typeinfo的未定义引用