Emil Dotchevski wrote:
On Thu, May 29, 2008 at 10:20 AM, Robert Ramey
wrote: #include
#include
.... // instanciate the code we want to generate and add tothe library template MyClass::serializeboost::archive::xml_oarchive;
template MyClass::serializeboost::archive::xml_iarchive;
Shouldn't there also be something to register the types and archives that are statically linked into the DLL so that serialization of shared_ptr
, etc. can find them?
This would be necessary for those types - and only those types which use BOOST_CLASS_EXPORT. In this case the BOOST_CLASS_EXPORT would go into the *.cpp module which explicitly instantiates the code for each archive.
Also, is it possible to safely unload a DLL that uses boost::serialization?
Yes - when the DLL is unloaded, the main registration table is updated accordingly. The only restriction is that you can't be unloading dlls at the same time you're serializing some type which requires code in that dll. Robert Ramey