Boost logo

Boost :

Subject: Re: [boost] [serialization] duplicate symbols when trying toBOOST_CLASS_EXPORT
From: V D (zedxz2_at_[hidden])
Date: 2011-12-02 12:46:14


Hi Robert,

Indeed the more recent documentation addresses this. http://www.boost.org/doc/libs/1_47_0/libs/serialization/doc/traits.html#export

So I added BOOST_CLASS_EXPORT_KEY2(B, "B") to my b header and BOOST_CLASS_EXPORT_IMPLEMENT(B) to b's cpp file.
I do not get the duplicate symbol anymore, good.

However the serialization now crashes.

My main is simply:

int main()
{
  std::ofstream of("mybin.bin");
  boost::archive::binary_oarchive oa(of);

  A* b = new B();
  oa << b;
   
  return 0;
}

Any idea ?

Thanks,
-V

On Dec 2, 2011, at 8:21 AM, Robert Ramey wrote:

> V D wrote:
>
>> If I don't have 2 files, then of course I don't have duplicate
>> symbols and the serialization of the polymorphic object works fine.
>>
>> Any idea how to resolve this issue?
>
> Look into the more recent documentation for EXPORT_KEY
> and EXPORT_IMPL which addresses this exact issue.
>
>>
>> Thank you
>> -V
>>
>> _______________________________________________
>> Unsubscribe & other changes:
>> http://lists.boost.org/mailman/listinfo.cgi/boost
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk