Boost logo

Boost :

Subject: Re: [boost] [1.44][serialization] Link error with polymorphic archives and BOOST_CLASS_EXPORT
From: Robert Ramey (ramey_at_[hidden])
Date: 2011-08-13 13:10:09


Ralph Tandetzky wrote:
> Hi,
>
> I discovered a problem, that has been previously discussed in a post
> from 2011-01-21 which has the same title. No concluding answer was
> given there, so I post the problem again. Essentially, the following
> code compiles but doesn't link:
>
> --------------------------
> #include <sstream>
>
> #include <boost/serialization/export.hpp>
> #include <boost/archive/polymorphic_binary_oarchive.hpp>
>
> class A {
> public:
> template<class Archive>
> void serialize(Archive & ar, const unsigned version)
> {
> }
> };
>
> BOOST_CLASS_EXPORT(A)
>
> int main()
> {
> A a;
>
> std::ostringstream os;
> boost::archive::polymorphic_binary_oarchive oa(os);
       boost::archive::polymorphic_archive & poa( oa );
       poa & a;
> }
> --------------------------

Does it work with the above changes?

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk