From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-01-22 04:01:15
Vladimir Prus wrote:
> IOW, it's required that archives to be used with exported classes
> are included before you do BOOST_EXPORT? Indeed, when I add
> #include <boost/archive/text_oarchive.hpp>
> everything starts to work. I guess I've no problem with this solution --
> since I don't know how else EXPORT would work.
> But it's unfortunate to get assert like above -- newbie will immediately
> decide it's a bug in serialization library. OTOH, requiring that all
> archive headers are included before BOOST_CLASS_EXPORT is probably
I've got more problems with this. I've tried to use xml_oarchive, and forgot
to include proper header before BOOST_CLASS_EXPORT. The program is attached,
and it crashes at runtime with segfault.
Here's what debugger shows:
Program received signal SIGSEGV, Segmentation fault.
0x4011d407 in std::ostream::sentry::sentry(std::ostream&) ()
#0 0x4011d407 in std::ostream::sentry::sentry(std::ostream&) ()
#1 0x4011cdd6 in std::ostream::put(char) ()
#2 0x0804cff7 in
std::ostream>::put(int) (this=0xbffff63c, c=10)
Heh, I'm using xml_oarchive, not text_oarchive, so seems like some code is
confused and uses text_oarchive when it should not.
Later on, I've added missing #include (commented out in derived.cpp in the
code I send). The results are not good, either. See attached error messages.
It seems that xml_oarchive expects NVP somewhere, but BOOST_CLASS_EXPORT fails
to provide it.
Finally, when I change 'derived.cpp' to start with:
to main.cpp before
and use binary_oarchive for storing, I get:
void boost::archive::basic_text_oarchive<Archive>::newtoken() [with Archive =
boost::archive::text_oarchive]: Assertion `false' failed.
Again, look like text archive is used... not binary one as should be.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk