Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] polymorphicarchivesindllsandpointer to derived problems
From: Robert Ramey (ramey_at_[hidden])
Date: 2011-01-04 23:53:41


Double check this to see if this helps.

Robert Ramey

Derived.cpp:

#include "Derived.h"

#include "boost/serialization/nvp.hpp"
#include "boost/serialization/nvp.hpp"

// make sure these are included BEFORE the EXPORT below.
// code is intantiatiated only for archives already "seen"

#include "boost/archive/polymorphic_iarchive.hpp"
#include "boost/archive/polymorphic_oarchive.hpp"

template<class Archive>
void Derived::serialize(Archive& ar, const unsigned int version)
{
    ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
    ar & BOOST_SERIALIZATION_NVP(j);
}

BOOST_CLASS_EXPORT_IMPLEMENT(Derived);
template void __declspec(dllexport)
Derived::serialize(boost::archive::polymorphic_iarchive& ar, const unsigned
int version);
template void __declspec(dllexport)
Derived::serialize(boost::archive::polymorphic_oarchive& ar, const unsigned
int version);


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