Re: [Boost-users] Exception when reading from an archive
--- Eyal Susser
Hi, I'm using the serialization library, but have encountered problems.
I have an archiver that I use with a stringstream to serialize objects. I write some ints to the archive using "ar << my_int", and finally I archive a derived class wi ar << derived. So far, so good.
In a different process, I create an input archiver, read the integers, and then pass the archiver to a different method, where I create an instance of the class I serialized and use "ar >> instance". This throws an exception.
The code for the object created is one *.so, and teh code that does the creating does it with a templated class factory in a different *.so. Is that why I'm gettin the exceptions? Is there a solution?
The exception is boost::archive::archive_exception what(): stream error.
Thanks.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Are you registering all your classes you are serializing?
Your input archiver may not know about all class types in
your archive.
Use the macro BOOST_CLASS_EXPORT(ClassName) to export a
GUID for every class. This should be in a .cpp file outside
of any functions. include
participants (1)
-
kauai