Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] boost::serialization adds huge amounts of exports to resultant Windows PE file
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-09-30 01:35:47


Chris Yuen wrote:
> Robert Ramey wrote:
>> These functions are not explicity called from the library.
>> But they ARE called as part of the serialization process. Its
>> just that MSVC doesn't see them. So when you compile
>> for release, The MSVC Linker strips them out and the
>> program won't work anymore. In order to work around
>> this, these functions are explicitly exported. This prevents
>> MSVC from stripping them out. For more information
>> see force_include.hpp
>
> Thanks for the pointer! I'm trying to circumvent the issue by
> replacing force_include.hpp with 2 lines:
>
> #define BOOST_DLLEXPORT
> #define BOOST_USED
>
> I'm not examining or not whether the resultant program will crash or
> not, yet. But still, even with force_include.hpp (supposedly) out of
> the way, I still see the swamp of exported symbols. How can I
> experiment with disabling this DLL export thingie?
>
> Do I need to recompile boost::serialization for this change? I assumed
> not since the exported symbols are template instantiations which
> should only have happened when the client code compiled.
>
> Is there any other ways around this? These exported symbols add a
> hideously huge amount of overhead to the final exe. I did the dumpbin
> and the output (which only contains the plain text names of the
> exported symbols) is 6MB!

Are you sure you're building in release mode?
>
> Best regards,
> Chris Yuen


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