Re: [Boost-bugs] [Boost C++ Libraries] #12336: Add Hint to BOOST_ALL_DYN_LINK=1 to serialization library

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12336: Add Hint to BOOST_ALL_DYN_LINK=1 to serialization library
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-11-02 19:34:19


#12336: Add Hint to BOOST_ALL_DYN_LINK=1 to serialization library
-------------------------------+---------------------------
  Reporter: georg@… | Owner: ramey
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: serialization
   Version: Boost 1.61.0 | Severity: Problem
Resolution: wontfix | Keywords: Documentation
-------------------------------+---------------------------
Changes (by ramey):

 * status: new => closed
 * resolution: => wontfix

Comment:

 "If i link static, the executable and the plugin dll, i get two
 registries. You can verify this if you check what extended_type_info
 object the BOOST_EXPORT_KEY_IMPLEMENT calls. I checked the this pointers
 of it.

 If i link all, the executable and the plugin with BOOST_ALL_DYN_LINK=1,
 then there is just one registry."

 Your idea to add it to the docs is not a bad one. I'll consider it. But
 the issue is much broader than that. In C++ if one builds with static
 libraries then link to a DLL, you can easily create a problem. This is
 because when one builds the app with static library, the linker then added
 all the C++ library stuff as static modules. Then you call a DLL. But
 the DLL -also written in C++ will also cal C++ library functions. Then
 either of the following occurs. If the DLL is linked statically, you've
 got the C++ function twice in the code. This is a problem for things like
 strtok and other stuff which carry an internal state. Or the DLL links to
 a C++ runtime and now you've go two different versions of the C++ library
 in your code. You can manage all this if you're careful - but its way too
 easy to create a failure which is almost impossible to find - as you've
 found out.

 So if you want write a good explanation of all this, I'll consider adding
 it to the tips and tricks section.

 Robert Ramey

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12336#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC