Honestly
I have been looking for a solution for hours before I made this post. I am not
so familiar with boost, the only module I use is serialization so maybe my
error is obvious but I went through all the doc on boost.org without luck.
I should have been
more descriptive I my first post. I does not work because I get unresolved
externals on the base class save / load functions when I implement the derived
class save/load functions. I am using the intrusive version of serialization
so their should be no particular namespace requirement. Here is a simplified
example of my problem:
/////////////////////////////////////
A.h
Class A:
{
friend class
boost::serialization::access;
template<class
Archive>
void save(Archive & ar, const unsigned
int version) const;
template<class Archive>
void load(Archive & ar, const unsigned int
version);
BOOST_SERIALIZATION_SPLIT_MEMBER()
};
/////////////////////////////////////
/////////////////////////////////////
B.h
class B: public A
{
friend class
boost::serialization::access;
template<class
Archive>
void save(Archive & ar, const unsigned
int version) const;
template<class Archive>
void load(Archive &
ar, const unsigned int file_version );
BOOST_SERIALIZATION_SPLIT_MEMBER()
}
BOOST_CLASS_EXPORT_GUID(B,
"B")
/////////////////////////////////////
/////////////////////////////////////
A.cpp
template<class Archive>
void A::save(Archive & ar, const
unsigned int version) const
{
ar &
var1;
}
template<class Archive>
void A::load(Archive &
ar, const unsigned int file_version )
{
ar
& var;
somestuff();
}
/////////////insert explicit instantiation for
text archives /////////
#include
<boost/archive/text_iarchive.hpp>
#include
<boost/archive/text_iarchive.hpp>
template void
A::load<boost::archive::text_iarchive>(boost::archive::text_iarchive
& ar, const unsigned int file_version );
template void
A::save<boost::archive::text_oarchive>(boost::archive::text_oarchive
& ar, const unsigned int file_version
);
/////////////////////////////////////