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


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/error_code.hpp: undefined reference to

We decided to fix these by defining the macro BOOST_ERROR_CODE_HEADER_ONLY
according to this link:

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.

Jonathan Jones

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at