Boost logo

Boost :

Subject: Re: [boost] [1.44][serialization] Link error with polymorphic archives and BOOST_CLASS_EXPORT
From: Ralph Tandetzky (ralph.tandetzky_at_[hidden])
Date: 2011-08-15 06:19:44


Thanks for your quick reply. But unfortunately it didn't help. I had a
little deeper look into the Archive Concept documentation and found the
following:
http://www.boost.org/doc/libs/1_47_0/libs/serialization/doc/archive_reference.html#usage
This refers to writing an own archive class and how to avoid compiling,
linking and execution failures in case of using the macro
BOOST_CLASS_EXPORT(). I checked in the header-file
     #include <boost/archive/polymorphic_binary_oarchive.hpp>
and the work-around using the macro
BOOST_SERIALIZATION_REGISTER_ARCHIVE() is implemented there. Still, it
might have to do something with that. Do you have any further ideas, how
to solve the problem?

Ralph Tandetzky.

Am 13.08.2011 19:10, schrieb Robert Ramey:
> 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