Boost logo

Boost Users :

Subject: [Boost-users] Pointer serialization
From: niranjan bangera (niranjannina_at_[hidden])
Date: 2009-01-21 10:14:43


hi am facing isssue in pointer serialization:

version:1.36.0
linux : g++ 4.1.1

Where in sample ex shows;

header file my.h contains:
-------------------------

class second
{
    int var1;
    float var2;
    template<class Archive>
    void serialize(Archive & ar, const unsigned int file_version)
    {
        ar & var1;
        ar & var2;
    }

};

class first
{

        second so;
    template<class Archive>
    void serialize(Archive & ar, const unsigned int file_version)
    {
        ar & so;
    }

};

mymain.cpp
----------

#include "my.h"

first *ptr;

{
std::ofstream ofs("filename");
boost::archive::text_oarchive oa(ofs);
oa << ptr:
}

here in while compiling this(my.cpp) i am getting these errors
--------------------------------------------------------------

/project_new/boost_1_36_0/include/boost-1_36/boost/archive/detail/oserializer.hpp:154:
undefined reference to
`boost::archive::detail::archive_pointer_oserializer<boost::archive::text_oarchive>::~archive_pointer_oserializer()'

/project_new/boost_1_36_0/include/boost-1_36/boost/archive/detail/oserializer.hpp:154:
undefined reference to
`boost::archive::detail::archive_pointer_oserializer<boost::archive::text_oarchive>::~archive_pointer_oserializer()'

/project_new/boost_1_36_0/include/boost-1_36/boost/serialization/extended_type_info_typeid.hpp:76:
undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::extended_type_info_typeid_0()'
/project_new/boost_1_36_0/include/boost-1_36/boost/serialization/extended_type_info_typeid.hpp:78:
undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::type_register(std::type_info
const&)'

/project_new/boost_1_36_0/include/boost-1_36/boost/serialization/extended_type_info_typeid.hpp:78:
undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::type_register(std::type_info
const&)'

/project_new/boost_1_36_0/include/boost-1_36/boost/serialization/extended_type_info_typeid.hpp:78:
undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::type_register(std::type_info
const&)'

/project_new/boost_1_36_0/include/boost-1_36/boost/serialization/extended_type_info_typeid.hpp:78:
undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::type_register(std::type_info
const&)'

/project_new/boost_1_36_0/include/boost-1_36/boost/serialization/extended_type_info_typeid.hpp:78:
undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::type_register(std::type_info
const&)'

......................

/project_new/boost_1_36_0/include/boost-1_36/boost/archive/detail/oserializer.hpp:94:
undefined reference to
`boost::archive::detail::basic_oarchive::end_preamble()'

/project_new/boost_1_36_0/include/boost-1_36/boost/archive/detail/oserializer.hpp:94:
undefined reference to
`boost::archive::detail::basic_oarchive::end_preamble()'

/project_new/boost_1_36_0/include/boost-1_36/boost/archive/detail/oserializer.hpp:94:
undefined reference to
`boost::archive::detail::basic_oarchive::end_preamble()'

Any suggestions will be accepted.

Regards
Niranjan



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net