Boost logo

Boost Users :

From: RIVASSEAU Jean Noel (JN.RIVASSEAU_at_[hidden])
Date: 2006-03-10 04:02:36


Hello

I am using gcc 3.4.2 (MinGW) and Boost 1.33.1 on Windows 2000 Professional.

I am quite surprised that you manage to compile this code correctly, even with gcc. I still have the error; I tried your hints - I completely removed any header inclusion to _typeid.hpp, and included _no_rtti.hpp before any serialization or header archive, but it still fails exactly on the same problem as before (with the same error message).

I am including my code here, if someone can try to compile it and report problems / successes it would be nice.

Jean-Noël

-----Message d'origine-----
De : boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] De la part de Robert Ramey
Envoyé : vendredi 3 mars 2006 17:53
À : boost-users_at_[hidden]
Objet : Re: [Boost-users] serialization: again a problem,failing to serialize a std::vector of pointers

OK - after changing some #include < to include "... I managed to compile
all the modules - including ClassSpecification_serialization.cc - with the
following compilers:

VC 7.1, gcc 3.4, Comeau, Borland 5.64 and Borland 5.51

I compiled against my more recent version which may be different
than the one you are using - I presume you're using 1.33? I did
find a minor problem with gcc in some code I recently added but
it is not related to this issue.

So I can't reproduce your exact problem. I might give some hints
though.

The current system needs an extended_type_info implementation.
This is specified by including a header - either
extended_type_info_typeid.hpp
or extended_type_info_no_rtti - which was just an example but I
guess its been found to be useful now. If neither of these is
expliclty #included, the system will #include extended_type_info_typeid.hpp
and mark it as the "default". Its possible that in some of your files
you're including "...no-rtti.pp" while in others nothing has been specified
so that "..._typeid.hpp" is being included. As a test you might try
including "..._no_rtti.hpp" above any serialization or archive headers.
and see if that makes a difference.

Robert Ramey

RIVASSEAU Jean Noel wrote:
> Sorry, I removed the QString stuff, so it should make more sense to
> you now. I have attached the cleaned up code. If you try to compile
> it, it will fail on the file
>
> ClassSpecification_serialization.cc
>
> with a message saying that there is a problem with the
> extended_type_info of std::vector< MemberVariableSpecification *>
> (since a member of ClassSpecification, which I serialize, is of this
> type).
>
> Don't pay attention as to what are my real intentions on this example
> code, this comes from my real project, and it would be long to
> explain. Just let's say that, no, I am not trying to store class id
> information into the archive, it is just that one data member of one
> of object that I need to serialize has the name class_id (but it
> could be named "walnut_field", the code would be the same).
>
> This small example code is just there to show you the bug that
> occurs.
>
> As for the mixing of type systems (no_rtti and type_id), it was just
> a test to see if that would change things. I have reverted it back in
> the attached code (only no_rtti used) but it still does not work.
>
> Thank you
>
> Jean-Noël
>
>
>
> -----Message d'origine-----
> De : boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]] De la part de Robert
> Ramey
> Envoyé : jeudi 2 mars 2006 18:06
> À : boost-users_at_[hidden]
> Objet : Re: [Boost-users] serialization: again a problem,failing to
> serialize a std::vector of pointers
>
> I took a look at this and it made no sense to me.
>
> I couldn't compile it as it needed a file QString to compile.
>
> I did have occasion to look into the code and Its not obvious to me
> what
> your intention here.
>
> It looks like you're trying to store class id information into the
> archive
> so that the proper
> class can be reconstructed. But that can't be it as the serialization
> library already does that.
>
> Also I notice that you're using extended_type_info_typeid as well as
> extended_type_info_no_rtti.
> This is very odd to me as I would expect that one's environment
> either has
> rtti enable or it doesn't.
> so I would expect either one or the other but not both.
>
> Anyway, sorrty I couldn't be more help.
>
> Robert Ramey
>
> "RIVASSEAU Jean Noel" <JN.RIVASSEAU_at_[hidden]> wrote in message
> news:87F60F7FA02FF749AFB02BD9FCAA6B04DA7ABF_at_naserv31.nanterre.oberthurcs.com...
> Hello
>
> This is my last problem with the BSL but the most important one
> (because
> there is no workaround).
>
> I am trying to serialize a class (whose name is "ClassSpecification")
> which
> has a std::vector of pointers. The code for serializing the class the
> pointer refer to (MemberVariableSpecification) is written and
> instantiated
> correctly. However I cannot correctly serialize the std::vector. It
> fails
> with a message complaining about:
>
> C:/Boost/include/boost-1_33_1/boost/archive/detail/iserializer.hpp:115:
> error: incomplete type
> `boost::serialization::extended_type_info_null<std::vector<MemberVariableSpecification*,
> std::allocator<MemberVariableSpecification*> > >' used in nested name
> specifier
>
> I do not understand why I need an extended_type_info for this vector.
> I sure
> need it for the class the pointers refer to (and I did specify it),
> but the
> std::vector itself is serialized as such, not as a pointer. Why do I
> get
> this error ???
>
> Can you please check the attached code and help me?
>
> Thanks
>
> Jean-Noël
>
> Ps: using gcc 3.4.2
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>
>
>
>
>
>
>
>> _______________________________________________
>> 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