Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] unable to fix UNREGISTERED CLASSexception
From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2010-02-17 12:14:20


In article <1566BED9-E306-41CC-A1D5-C7617A0C1043_at_[hidden]>,
david.graf_at_[hidden] says...
>
> Hello Robert
>
> I fixed the example. I had to add somewhere a virtual function. Otherwise, the polymorphism doesn't work.
>
> Unfortunately, I have a new problem. If I put the code into a static library, the serialization from the outside doesn't work anymore. Then, I get a unregistered class exception. It only works when I put the code to execute the serialization into the cpp file where the classes are registered with BOOST_CLASS_EXPORT_GUID.
>

You do know that you can manually register items, right?

template < typename Archive >
void register_objects(Archive & ar)
{
  ar.template register_type<derived_type>();
}

I ended up having to use this for whatever reason I don't recall.

-- 
http://crazyeddiecpp.blogspot.com

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