|
Boost Users : |
From: Sigurd Saue (ssaue_at_[hidden])
Date: 2006-04-05 06:04:07
Thanks. You are probably right - interesting to hear if anyone else has had
the same problem.
I just wanted to make sure that there are no issues regarding size_t and
pointer sizes that could cause this somewhere in the serialization library
(improper initializations, etc.).
I will try the other approaches shortly.
Sigurd
-----Opprinnelig melding-----
Fra: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]]Pa vegne av Robert Ramey
Sendt: 4. april 2006 17:27
Til: boost-users_at_[hidden]
Emne: Re: [Boost-users] Serialization problem on 64-bit Windows release
Looks like a compiler bug to me.
You might try the BOOST_CLASS_EXPORT method.
You might try the alternative registration syntax:
ar.template register_type<FloatParameter>(); ...
You might ask microsoft - lol
Other than that I'm not sure what to suggest.
Robert Ramey
Sigurd Saue wrote:
> We've started to use boost serialization and I've run into problems
> with serialization of derived classes. The "funny" thing is that this
> happens only on 64-bit Windows release compiled with MS Visual 2005.
> The same code works fine on Linux 32/64 bit debug/release, on Windows
> 32-bit debug/release and on Windows 64-bit debug. But not Windows
> 64-bit release. We use boost version 1.33.1.
>
> Here's the code that causes problems (Parameter is the base class,
> ParamCollection is a vector of Parameters):
>
> template<class Archive>
> static void serialize(Archive & ar, ParamCollection & col, const
> unsigned int /*version*/)
> {
> ar.register_type(static_cast<FloatParameter*>(NULL));
> ar.register_type(static_cast<IntParameter*>(NULL));
> ar.register_type(static_cast<ChoiceParameter*>(NULL));
> ar.register_type(static_cast<StringParameter*>(NULL));
> ar.register_type(static_cast<BlobParameter*>(NULL));
>
> ar & boost::serialization::base_object<std::vector<Parameter*>
> >(col); }
>
> When serializing the ParamCollection (serializing, not deserializing)
> an archive exception is thrown: unregistered class. I've tried to use
> both abstract and non-abstract base class without any success. I did
> some research in the boost code and found that the exception was
> thrown in polymorphic::save (oserializer.hpp) by the last condition
> (NULL == bpos_ptr).
>
> Any clues? Is there a workaround?
>
> Thanks,
> Sigurd
_______________________________________________
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