Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost-Serialization] Problem with BOOST_CLASS_EXPORT
From: Kenny Riddile (kfriddile_at_[hidden])
Date: 2009-09-03 10:29:21


Soumen wrote:
> Hi,
>
> I'm getting conflicting declaration with BOOST_CLASS_EXPORT and I think I've
> got the reason. But I'm not aware of clean solution to overcome this. Let me
> explain the problem here.
>
> Say in FileAB.h, I've class A, class B defined. I've a FileSExportAB.h where
> I've BOOST_CLASS_EXPORT(A) at line say 10 and BOOST_CLASS_EXPORT(B) at line
> 11.
>
> Similarly I've class C and class D defined FileCD.h. And FileSExportCD.h has
> BOOST_CLASS_EXPORT(C) @ line 10 and BOOST_CLASS_EXPORT(D) @ line 11.
>
> And while building, I get error like following:
>
> ------------------------------------------------------------------------------------------------
> FileSExportCD.h:10: error: conflicting declaration ‘const
> boost::archive::detail::guid_initializer<C>&
> <unnamed>::boost_serialization_guid_initializer_10’
> FileSExportAB.h:10: error:
> ‘<unnamed>::boost_serialization_guid_initializer_10’ has a previous
> declaration as ‘const boost::archive::detail::guid_initializer &
> <unnamed>::boost_serialization_guid_initializer_10’
> ------------------------------------------------------------------------------------------------
>
> All A, B, C and D are in same namespace. Putting things at different
> namespace is overkill on legacy code.
>
> Is using BOOST_CLASS_EXPORT_GUID only better solution? Is it not pssible for
> boost to resolve it automatically with BOOST_CLASS_EXPORT macro?
>
> Regards,
> ~ Soumen

Which version of boost are you using? I ran into this problem a few
versions ago and a patch was submitted that fixes it.


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