|
Boost Users : |
From: Tim St. Clair (timothysc_at_[hidden])
Date: 2008-08-21 10:32:12
It may help is you give some sample code. Presently there are too many
unknown(s) to give an accurate answer. I have some speculations;
1.) You may want to take a look at the test_no_rtti.cpp example for more
details. $BOOST_ROOT/libs/serialization/test
2.) You could check the docs on EXPORT && TYPE_INFO as well.
Cheers,
Tim
On Thu, Aug 21, 2008 at 5:01 AM, Hansi <hansipet_at_[hidden]> wrote:
> Hello,
>
> I have a problem to serialize a derived class.
> In some classes I use a shared_ptr<A> which acts as a interface for some
> other classes.
>
> Til now I had the implementation in the header and it worked fine with the
> BOOST_CLASS_EXPORT(B)
> declaration after at the end of the header file where B was defined.
>
> For performance reason (compile time) I have moved the serialization code
> from the header file (there is only the declaration) to the .cpp file (now I
> use also only the polymorphic_binary_archive). There I have also the
> declaration for the polymorphic_binary_archive
>
> template void B::serialize(boost::archive::polymorphic_iarchive& ar, const
> unsigned int file_version);
> template void B::serialize(boost::archive::polymorphic_oarchive& ar, const
> unsigned int file_version);
>
> After linking I have now some linker errors. First for the class B which is
> derived from A and for the class A. All linker errors use the
> binary_archive.
>
> If I declare the "BOOST_CLASS_EXPORT(B)" at the end in the .cpp file I get
> only an linker error for class A.
> How I can solve this?
>
> Best regards
> Hansjörg
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
-- Regards, Timothy St. Clair [timothysc_at_[hidden]]
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