Boost logo

Boost Users :

From: RIVASSEAU Jean Noel (JN.RIVASSEAU_at_[hidden])
Date: 2006-02-28 10:13:13


You should send a code snippet.

What are the syntax error you get, and the error you get when doing a "BOOST_CLASS_EXPORT(derived);" ?

I also have a problem with an abstract base class (although at link time, not compile time). Try removing the pure virtual function (just to see if it works).

Another hint too would be to try to serialize a constant member; sometimes I had strange ASSERTION_FAILURE related to serialization of non-constants (this is also explained in the docs).

Jean-Noël

-----Message d'origine-----
De : boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] De la part de Tobias Combe
Envoyé : mardi 28 février 2006 13:18
À : boost-users_at_[hidden]
Objet : [Boost-users] problem with serialization of pure virtual

Hello

I read the documention and some prior postings to related topics.
But none of the proposed solutions seems to work for me.

My problem:

I have an abstarct base class(with pure vitual function) and several
derived from that. All are written in the same source/header -file. I
want to serialize an object via a pointer to the base-class.
When i use "ar.register<derived>();" in the template of the base-class
to register the derived classes, i get a syntax error.
When i export them with "BOOST_CLASS_EXPORT(derived);" or
BOOST_CLASS_EXPORT_GUID(derived,"derived") it doesn't work (i think
because they are all in the same file).
I'm also using "BOOST_IS_ABSTRACT(base);"
When i comment "oa << object;" ervything compiles fine.
Uncommented i get a:
boost/archive/detail/oserializer.hpp:567: error: incomplete type `
 boost::STATIC_ASSERTION_FAILURE<false>' does not have member `value'
error...

So is there a solution (without seperating the derived classes into
different files) for this problem?
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net