I think this is because one half of code that registers classes relationship resides in derived.so and the other part resides in main. The first part is the
BOOST_CLASS_EXPORT_GUID(derived,"derived") - it instantiates pointer_oserializer and pointer_iserializer for known archives and derived (and, in turn,
extended_type_info for derived), the second pairt is in derived serialize function - "ar & boost::serialization::base_object<base>(*this);" - it instantiated in main and calls void_cast_register internally. Try to move BOOST_CLASS_EXPORT_GUID(derived,"derived") into derived.hpp - I guess that it will force instantiation of pointer_oserializer/pointer_iserializer in main.
I had similar problem with MSVC.
Sorry for my poor English
"Jeshua Bratman"
John Pye-4 wrote:
Hi Jeshua,
Vaguely related comment on your problem. I was also recently seeing this "unregistered void cast" runtime error. As far as I could tell it was a problem relating to my ordering and placement of "#include
(or ditto iarchive), and "#include as well as calls to BOOST_CLASS_EXPORT. It was nothing to do with my use of void_cast_register, which in fact I don't use anywhere in any of my code.
So FWIW I think that this error message is not particularly helpful or well-worded.
Cheers JP
JP,
Thanks for the comment.
This issue was mentioned to me in my previous message I sent out. I believe I have the includes ordered correctly. What Robert said was that I need to include the archives before the export header file. Here's the order in which I include the serialization headers:
#include
#include #include #include #include Here is my code just to make things easier. There should be 5 files: Makefile main.cpp base.hpp derived.hpp derived.cpp
http://www.nabble.com/file/p12487645/serialization_dynamic_test.tar.gz serialization_dynamic_test.tar.gz
Thanks, Jeshua Bratman -- View this message in context: http://www.nabble.com/-boost%3A%3Aserialization--Serializing-Dynamically-Loa... Sent from the Boost - Users mailing list archive at Nabble.com.