Boost logo

Boost-Build :

Subject: Re: [Boost-build] [Boost-users] [System] Link issues using BOOST_ERROR_CODE_HEADER_ONLY
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2015-02-07 02:30:24


Le 06/02/15 20:36, Jonathan Jones a écrit :
> Hello,

Hi, adding the Boost build list.
>
> We're in the process of upgrading from Boost 1.49 to Boost 1.56.
>
> As part of this upgrade, we've noticed the linkage requirements for using
> the "system" library are much more strict in 1.56. We are getting linker
> errors like the following across dozens of our libraries:
>
> boost/system/error_code.hpp: undefined reference to
> `boost::system::generic_category()'
> boost/system/error_code.hpp: undefined reference to
> `boost::system::system_category()'
>
>
> We decided to fix these by defining the macro BOOST_ERROR_CODE_HEADER_ONLY
> according to this link:
>
>
> http://www.boost.org/doc/libs/1_56_0/libs/system/doc/reference.html#Header-
> error_code
>
>
> However, when building Boost itself with this macro defined, we're
> encountering several problems:
> 1) Some Boost libraries (chrono, filesystem, random) that use the
> "system" library no longer link, as if they are still expecting
> the library to be present. Note that some libraries, like thread,
> that use "system", link fine without the shared library being present.
> 2) We get multiple definitions of "boost::system::throws"
>
> Any thoughts on how to resolve these? Google search has not turned up any
> bugs that I can find.
>
>
on what concerns chrono and thread libraries, could you try the following
* in libs/chrono/build/Jamfile.v2 change the comments

         <library>/boost/system//boost_system
         #<define>BOOST_ERROR_CODE_HEADER_ONLY

by

         #<library>/boost/system//boost_system
         <define>BOOST_ERROR_CODE_HEADER_ONLY

* in libs/thread/build/Jamfile.v2 change

       <library>/boost/system//boost_system

by

         #<library>/boost/system//boost_system
         <define>BOOST_ERROR_CODE_HEADER_ONLY

Note to the Boost Build ML. What is the best way to solve this issue? I
suspect that we need a header_only feature in Boost.System and that the
the other libraries must be build in function of this feature.

Best,
Vicente


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk