Linking to a library that defines the missing character ( -lboost_system ) is an obvious solution, but in the particular Boost.System case, the inaccuracy in the original project forces us to use boost::system::generic_category() and boost::system::system_category() unnecessarily . Compiling with the -DBOOST_SYSTEM_NO_DEPRECATED flag disables this code and allows you to compile several programs without requiring -lboost_system (this link, of course, is still necessary if you explicitly use some of the library functions).
Starting with Boost 1.66 and this commit , this behavior is now the default, so hopefully fewer and fewer users will have to answer this question.
As @AndrewMarshall noted, an alternative is to define BOOST_ERROR_CODE_HEADER_ONLY which allows a version of the code for the header only. However, this is not recommended by Boost, as it may interfere with some functions.
Marc Glisse Jun 16 '15 at 20:38 2015-06-16 20:38
source share