Re: [Boost-bugs] [Boost C++ Libraries] #6899: boost serialization calls wrong guild()

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6899: boost serialization calls wrong guild()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-07-18 16:38:46


#6899: boost serialization calls wrong guild()
--------------------------------------------+-------------------------------
  Reporter: Xiaolong <xwu622@…> | Owner: ramey
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: serialization
   Version: Boost 1.44.0 | Severity: Problem
Resolution: invalid | Keywords: guid
--------------------------------------------+-------------------------------

Comment (by anonymous):

 "I have 6 analytic libraries. I create a static library of boost-
 serialization wrapper for each of them. Then I link the 6 static
 serialization libraries into a dynamic library."

 This is known to be a risky operation. Each static library will include
 static functions from the C runtime library which will be included in the
 dynamic library when it is made. If the main program is linked
 dynamically with the c runtime library, there will be different versions
 for the same code in the DLLS and the main line. This will violate the
 ODR. The problem is compounded when the main line is built with older
 DLLS. I would recommend the following:

 Build all the DLLS with the dynamic version of the C Runtime library and
 other tools like the serialization library.

 Build the Mainline with dynamic linking of libraries.

 This will gain you the following advantages:

 a) Only ONE version of every routine in your code - eliminates confusion
 and potential for weird untraceable errors.
 b) With a little bit of work, you can load the DLLS "on demand" so they
 don't even get loaded when the main line doesn't use them. This is very,
 very useful for polymorphic types. An example is that one could have a
 complex mainline application which uses serialization library archives -
 but only through the polymorphic interfaces. When you use a new/updated
 archive/serialization code, it can be used without even re-compiling the
 mainline!
 c) The code body to be shipped to the customer is smaller as it has no
 redundancies.

 and a disadvantage

 a) you have to ship the MS C runtime DLL along with your product.

 So, try building everything for dynamic linking and see if it helps.

 Robert Ramey

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6899#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:10 UTC