0

我正在使用 Boost 1.53,我想序列化该类。

serialize.h文件指定:

class serialize
{
   private: 
       map<int, Test*> testMap;
}

serialize.cpp文件指定:

void main()
{
    ofstream ofs(xxx/xxxx);
    {
        archive::binary_oarchive oar(ofs);
        oar << serialization::make_nvp("test", testMap);
    }
}

Test.h文件指定:

using namespace boost;

class Test
{
private:
    friend class serialization::access;
    template <class Archive>
    void serialize(Archive& archive, unsigned int version)
    {
        archive & value;
    }
public:
    int value;
}

链接以下错误:

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'

请告诉我有什么问题!!!

4

0 回答 0