Boost logo

Boost Users :

Subject: [Boost-users] [System] Link issues using BOOST_ERROR_CODE_HEADER_ONLY
From: Jonathan Jones (Jonathan.Jones_at_[hidden])
Date: 2015-02-06 14:36:35


Hello,

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.

Sincerely,
Jonathan Jones


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