Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] 1.56.0 - unregistered_class exception while using EXPORTs
From: Todd Seiler (todd.seiler_at_[hidden])
Date: 2014-08-20 02:02:48


On 8/19/14 8:40 PM, aragonsr wrote:
> It's on load.
>
> I'm just testing with a single derived class.
>
> My base class is an abstract polymorphic base class. So I didn't use
> "base_object<BaseType *>(this)" in the derived class. Is this correct?
> There's nothing in the base class to serialize. it sounds like you're
> telling me, even if it's abstract, I should go ahead and use
> "base_object<BaseType *>(this)"? I'll give that a shot.. I guess..
>
> I meant examples in the documentation. Specifically:
> http://www.boost.org/doc/libs/1_56_0/libs/serialization/doc/serialization.html#runtimecasting
> <http://www.boost.org/doc/libs/1_56_0/libs/serialization/doc/serialization.html#runtimecasting>
>
> I'm using polymorphic archives throughout the application in all the
> object's I'm trying to serialize / deserialize. And I'm explicitly
> instantiating the templates like the documentation says.
>
> "But most linkers strip out code which is known to be called."
> That doesn't make sense. Do you mean "which is NOT called"?
>
> I didn't know about the dll static lib thing. Never thought about it. This
> gives me something to chew on for a while. Thanks!
>
>
>
> --
> View this message in context: http://boost.2283326.n4.nabble.com/Serialization-1-56-0-unregistered-class-exception-while-using-EXPORTs-tp4666610p4666623.html
> Sent from the Boost - Users mailing list archive at Nabble.com.
>
As it turns out, it appears that you were correct when you stated that
mixing static and dynamic libs is a bad idea. I had no idea. After
running several different tests, I was able to get it to work.

I put the serialization code inside the same dll that the serialization
operation was initiated from and that worked. I then put the
serialization code inside of a different dll and initiated the
serialization from a separate dll. This also worked. I also tested using
the manual void_register call and implementing a dummy serialize method
in the base class, both worked when I took the static lib out of the
equation.

Thanks a ton!


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