Ok first I hadn't realised my attachment was removed. So I include the
source code below. This is small and self contained.
o The compile error on AIX was removed because I saving via a non const
variable. ( Note however gcc 4.2.1. on Linux it did not complain.)
o To recap this compiles and runs on Linux with gcc 4.2.1 but
crashes/exception on AIX V10.1. Because it reckons the derived/base
relationship has not been registered.
... oserializer.hpp
// convert pointer to more derived type. if this is thrown
// it means that the base/derived relationship hasn't be
registered
vp = serialization::void_downcast(
*true_type,
*this_type,
static_cast
archive_exception(archive_exception::unregistered_cast)
); }
Note if a save via the derived ptr, then it works. o If I explicitly register this relationship, (see code below) Then I get past the first exception only to get an assert. // since true_type is valid, and this only gets made if the // pointer oserializer object has been created, this should never // fail const basic_pointer_oserializer * bpos = archive_pointer_oserializer<Archive>::find(* true_type);
assert(NULL != bpos);
if(NULL == bpos) boost::serialization::throw_exception(
archive_exception(archive_exception::unregistered_class)
);
ar.save_pointer(vp, bpos);
o Initially I thought it was compiled without rtti on AIX.
However this was not the case. Here is compile line.
xlC -c -DDEBUG -qcpluscmt -qNOOPTimize -qnoinline -g
-qfullpath
-qfuncsect
-qeh
-qrtti
-qtemplatedepth=700
-I"../SCRATCH/src"
-I"/s1a/emos_esuite/emos_data/sms/boost_1_39_0"
-o "bin/vacpp/debug/src/TestSerialisation.o"
"src/TestSerialisation.cpp"
This is show stopper bug that I must get fixed.
Are there any more things I can try to debug this ?
Any help would be much appreciated.
//=============== the example ========================
#include <fstream>
#include