Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] test_dll_exported in VS2012
From: Nat Goodspeed (nat_at_[hidden])
Date: 2014-01-17 10:15:10


On Fri, Jan 17, 2014 at 2:45 AM, Stefan Gradinger
<stefangradinger_at_[hidden]> wrote:

> The serialization of of objects through thier polymorphic base class in a
> dynamic library appearently requires that boost ist also linked dynamic,
> which is achieved by adding the BOOST_ALL_DYN_LINK=1 define.
>
> Maybe someone can add this point to the documentation.

I don't know if it's already mentioned there, and perhaps it does
deserve calling out specially.

If it's not yet mentioned, though, it might be because this is only a
particular case of a much more general problem. Of your main
executable and the dynamic libraries it loads, if any two of them use
the same library, you must dynamically link with that library.
Otherwise you have two (or more) instances of the library and its data
in the process's memory. "Singletons" become "doubletons." Trouble
ensues -- as you discovered.


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