Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2007-08-09 23:33:11


Double check that you're using the macro outside any namespace.

Double check that the EXPORT is in the same module as the headers

Double check - for 1.33 that the archive headers are before the export
header.

Check test export and compare it with your own code.

Robert Ramey

Jeshua Bratman wrote:
> First of all, thank you for the quick and helpful reply!
>
> I did as you suggested as to serializing the pointer. It does make
> much more sense that way, and now it throws an useful exception when
> I try this serialization:
>
>
> terminate called after throwing an instance of
> 'boost::archive::archive_exception'
> what(): unregistered class
>
> So clearly I need to export the class as you said because the derived
> class has not been registered.
>
>
>
> Robert Ramey wrote:
>>
>>> I can't use the BOOST_CLASS_EXPORT_GUID(derived,
>>> "derived") macro discussed on that page because main does not know
>>> what a derived object is (this is the whole point of having this
>>> plugin system).
>>
>> In order to make this link and run correctly as it stands, you'll
>> have to use EXPORT. To make it work as desiired for plugins,
>> include it
>> in the modules which implement the plug - in - not the main and
>> not the base class.
>>
>
> I tried exporting the derived class in derived.cpp:
>
> BOOST_CLASS_EXPORT_GUID(derived,"derived")
>
>
> But then when I compile the shared library I get about 100 compile
> errors, many similiar to this:
>
> error: incomplete type
> 'boost::serialization::extended_type_info_null<derived>' used in
> nested name specifier
>
> Do you know what this could be about? I'm guessing it is just
> something simple I'm not thinking about, but I can't seem to get it
> to export.
>
> This seems very similar to someone else's unresolved problem:
> http://www.nabble.com/-Serialization--Problem-serialization-of-derived-classes-tf2960557.html#a8282732
> http://www.nabble.com/-Serialization--Problem-serialization-of-derived-classes-tf2960557.html#a8282732
>
> I am using gentoo with
> gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3),
> and
> boost-1.33.1-r1
>
>
> Jeshua


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