
I have a shared library for derived and base classes. My code passes instances of derived classes T using boost::shared_ptr<B> to the base class. This all works as expected. I've used the BOOST_CLASS_EXPORT_KEY and BOOST_CLASS_EXPORT_IMPLEMENT macros to register both the classes Tand shared_ptr<T> typedefs to all the classes. If I attempt to serialize a base class pointer, boost::serialization can not find the serialize member for the shared_ptr to the derived class. However, if I don't register the shared_ptr<T> for each derived class T in the shared library, but instead use BOOST_EXPORT_CLASS(shared_ptr<T>) in main(), everything works fine. Is there a workaround so that I don't need BOOST_EXPORT_CLASS(shared_ptr<T>) in main() for every possible derived class? Thanks. I can provide a trivial example that illustrates this issue if that would help.