Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2008-03-14 13:01:26


I'm not sure what "shared object" means here.

CClasifier contains:
    ...
    CLabels * labels;

    template<class Archive>
    serialize(Archive &ar , unsigned int version){
        ar & labels;
    }
    ....

Which should be fine as is if labels in fact a pointer to one instance of
CLabels.

If labels is a base class pointer to a more derived type,
it,s THAT derived type which must be exported.

Robert Ramey

Christian Widmer wrote:
>> Dear Robert,
>>
>>
>> thank you for your reply. After struggling with some other issues
>> for a couple days, I've compiled boost-1.34 with the serialization
>> patch from your website, as you suggested.
>>
>> In deed, the "unregistered class" problem disappeared, but was
>> unfortunately replaced by a "unregistered void cast" exception when
>> trying to serialize across shared-object boundaries.
>>
>> All classes are registered using BOOST_CLASS_EXPORT in their
>> respective .cpp file, yet I can't get it to work. I attached a piece
>> of my code to this email. The attached archive contains the
>> following files:
>>
>> - Classifier.h
>> - Classifier.cpp
>> - Labels.h
>> - Labels.cpp
>>
>> The class CClassifier has a field labels of type CLabels. The classes
>> are contained in two separate shared-objects. When trying to
>> serialize an object of type CClassifier, an exception gets thrown
>> when attempting to serialize the field labels. Any ideas?
>>
>>
>> Best regards,
>>
>> Christian Widmer
>>


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