Boost logo

Boost Users :

Subject: Re: [Boost-users] [MPI] Derived class not properly registered, even if it is.
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-06-10 15:56:50


AMDG

Mathieu Larose wrote:
> I realized that if I uncomment these lines in main.cpp:
>
> #include <boost/serialization/export.hpp>
> BOOST_CLASS_EXPORT(B);
>
> My code runs correctly.
>
> It seems that BOOST_CLASS_EXPORT needs to be in the same .cpp file
> (i.e main.cpp) where MPI is used. When using serialization only,
> BOOST_CLASS_EXPORT could be in any .cpp files.
>
> Is this normal?
>
> Also, if A is no more an abstract class, BOOST_CLASS_EXPORT(B); could
> be called from other.cpp and the code runs correctly.
>
> I'm using version 1.39.0.
>

You need to #include all the appropriate archive headers before
using BOOST_CLASS_EXPORT. In this case you need
<boost/mpl/packed_oarchive.hpp> and
<boost/mpi/packed_iarchive.hpp>, I think.

In Christ,
Steven Watanabe


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