Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-02-23 21:22:53


I recommend puting BOOST_CLASS_EXPORT in the header rather
than in the *.cpp file. The same goes for all serialization traits.
Generally
a class should be loaded with the same traits as when it is saved. Putting
traits in the header assures this to be the case.

Robert Ramey

Marcin Kalicinski wrote:
> I noticed strange behavior of serialization on VC 8.0. I use
> BOOST_CLASS_EXPORT macro in a .cpp file to register a derived class,
> so that it can be properly serialized through base class pointer.
> This works fine, as long the .obj file resulting from compilation of .cpp
> file which
> uses BOOST_CLASS_EXPORT macro is linked directly to the final
> executable. But when I first put this .obj file into a static library, and
> then link
> the library to executable, I start getting unregistered_class
> exceptions - as if there was no BOOST_CLASS_EXPORT invoked.
>
> So far I believed that there is no difference between linking to
> object file and to static library file containing that object file.
> It seems my beliefs were now shattered.
>
> Has anybody else had this issue before?
>
> Thank you,
> Marcin
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


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