在boost序列化中序列化“地图”成为链接错误。
#include <boost/serialization/map.hpp>
#include <boost/archive/binary_oarchive.hpp>
map<int, int> map;
ofstream ofs(testpass);
{
archive::binary_oarchive oar(ofs);
oar << map;
}
ofs.close();
链接错误:
boost::serialization::typeid_system::extended_type_info_typeid_0::is_less_than(boost::serialization::extended_type_info const&) const:libs/serialization/src/extended_type_info_typeid.cpp:56: error: undefined reference to 'std::type_info::before (std::type_info const&) const'
当您更改"string"
or"int"
而不是 时map<int, int>
,错误将被清除。boost的版本是1.53。
怎么了?