Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] problem using BOOST_CLASS_EXPORT macro in a static library
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-02-11 12:50:08


Hmmm I can't find it either but I know it must be possible. Robert?

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode

On Wed, Feb 11, 2009 at 6:13 AM, Jeff Flinn
<TriumphSprint2000_at_[hidden]> wrote:
> Emil Dotchevski wrote:
>>
>> BOOST_CLASS_EXPORT relies on global objects' constructors to register
>> the necessary types, however the C++ standard allows a compiler to
>> strip away such objects unless they are actually used.
>>
>> The C++ standard guarantees that all global objects contained in a
>> compilation unit (a CPP file) are initialized by the time execution
>> enters a function from that compilation unit. So, if execution never
>> enters a function from that compilation unit, the compiler is allowed
>> to deadstrip it.
>>
>> You have 2 options:
>>
>> 1) tinker with your code to trick the compiler into leaving in (not
>> deadstripping) the automatic BOOST_CLASS_EXPORT registration (which is
>> usually possible), or
>>
>> 2) register the classes explicitly (not automatic, but guaranteed to work)
>
> I can't find 2 in the docs, Can you point me to where to find it?
>
> Thanks, Jeff
>
> _______________________________________________
> 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