Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] Export macro doesnt work
From: Jari (jaristr_at_[hidden])
Date: 2011-08-11 15:50:59


Ok I tried one test code and it worked, but when I moved the all the
classes in header file and but the export macro in cpp file it fails
with "derived class not registered or exported".

Then I moved the export macros to main.cpp right before main() and
before the saving/loading calls, and that did the trick.

So it seems export's need to be in same CPP file where the
loading/saving starts?
Or is it in same cpp where the function is?

Im using visual studio 10 express

On Thu, Aug 11, 2011 at 10:27 AM, Robert Ramey <ramey_at_[hidden]> wrote:
> Jari wrote:
>> I have rather simple project considering its not DLL or Lib where I
>> need those exports. And I honestly dont know what the manual is saying
>> about BOOST_CLASS_EXPORT as I have applied it to my project according
>> to my best ability, and it doesnt work.
>>
>> So can you help and give instruction how to use the macro?
>>
>> I have included BOOST_CLASS_EXPORT(SomeClass) after every #include
>> "SomeClass.h" but something is wrong.
>>
>> I dont know what to try.
>>
>> I followed the manual to my best ability.
>
> Try building one of he demos or tests that come with the library.
>
> Make sure that your base classes have at least one virtual function.
>
>>
>> thanks.
>>
>>
>> On Thu, Aug 11, 2011 at 7:51 AM, Robert Ramey <ramey_at_[hidden]> wrote:
>>> Jari wrote:
>>>> Hi
>>>> I was trying to use BOOST_CLASS_EXPORT for all my classes in order
>>>> to save them but I always got unregistered class error.
>>>> So I used oa.register_type<object>(); for the class that was causing
>>>> the error and problem solved. But why doesnt the BOOST_CLASS_EXPORT
>>>> macro work?
>>>
>>> because you're not using it properly.
>>>
>>>> Why I need to use oa.register_type<object>(); ?
>>>
>>> because you can't get EXPORT to work.
>>>
>>> Robert Ramey
>>>
>>>> Im using Boost 1.46.1
>>>>
>>>> Thanks
>>>
>>>
>>>
>>> _______________________________________________
>>> Boost-users mailing list
>>> Boost-users_at_[hidden]
>>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>
> _______________________________________________
> 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