Boost logo

Boost Users :

Subject: [Boost-users] [serialization] redefinition of ‘struct boost::archive::detail::init_guid<T>
From: Jan Boehme (jan.boehme_at_[hidden])
Date: 2009-03-09 12:58:10


Hi,

I have something like the following object hierarchy:

class Root {};
class A : Root {}; // BOOST_CLASS_EXPORT in header file
class B : Root {}; // BOOST_CLASS_EXPORT in header file

class U : A {}; // BOOST_CLASS_EXPORT in header file
class V : A {}; // BOOST_CLASS_EXPORT in header file

class X : B {}; // BOOST_CLASS_EXPORT in header file
class Y : B {}; // BOOST_CLASS_EXPORT in header file

There are a lot of shared pointers to the base classes Root, A and B
which are to serialize.Boost 1.37 works fine while Boost 1.38 brings
"redefinition of ‘struct boost::archive::detail::init_guid<A>"
"redefinition of ‘struct boost::archive::detail::init_guid<B>"
"redefinition of ‘struct boost::archive::detail::init_guid<U>"
"redefinition of ‘struct boost::archive::detail::init_guid<V>"
"redefinition of ‘struct boost::archive::detail::init_guid<X>"
"redefinition of ‘struct boost::archive::detail::init_guid<Y>"

after trying to link.

It seems clear I have to put the BOOST_CLASS_EXPORT stuff in the
belonging implementation files. But this corrupts the input of files
which were created with the former binaries using the
BOOST_CLASS_EXPORT in the header.

I need an advice how and where the macro to place in terms of a long
time decision. Below the class definition (which I find a good
solution) seems no longer to work.

Thank you very much,
Jan.


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