Boost C++ Libraries: Ticket #9472: Undocumented define causes header-only libraries to have link dependency on system https://svn.boost.org/trac10/ticket/9472 <p> Code using the ASIO library must be linked with a boost binary lib, even though asio is considered 'header only' library. </p> <p> Test system - ubuntu 13.10, using boost 1.55 download archive (not installed package). </p> <p> Similar problem reported in ticket 7085. Suspect this is systemic. </p> <p> Demo source code: </p> <pre class="wiki">/* $ g++ -I. -Wall asio_link_fail.cpp -Wno-unused-local-typedefs /tmp/ccjgSD3Q.o: In function `__static_initialization_and_destruction_0(int, int)': asio_link_fail.cpp:(.text+0x50): undefined reference to `boost::system::generic_category()' asio_link_fail.cpp:(.text+0x5a): undefined reference to `boost::system::generic_category()' asio_link_fail.cpp:(.text+0x64): undefined reference to `boost::system::system_category()' /tmp/ccjgSD3Q.o: In function `boost::asio::error::get_system_category()': asio_link_fail.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[_ZN5boost4asio5error19get_system_categoryEv]+0x7): undefined reference to `boost::system::system_category()' collect2: error: ld returned 1 exit status */ #include "boost/asio.hpp" int main() { return 1; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9472 Trac 1.4.3 anonymous Wed, 04 Dec 2013 22:14:45 GMT <link>https://svn.boost.org/trac10/ticket/9472#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9472#comment:1</guid> <description> <p> Verified failure in 131204 trunk as well. </p> </description> <category>Ticket</category> </item> <item> <author>soda@…</author> <pubDate>Thu, 05 Dec 2013 21:29:27 GMT</pubDate> <title>owner, component, summary changed; cc set https://svn.boost.org/trac10/ticket/9472#comment:2 https://svn.boost.org/trac10/ticket/9472#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">soda@…</span> added </li> <li><strong>owner</strong> changed from <span class="trac-author">chris_kohlhoff</span> to <span class="trac-author">Matias Capeletto</span> </li> <li><strong>component</strong> <span class="trac-field-old">asio</span> → <span class="trac-field-new">Documentation</span> </li> <li><strong>summary</strong> <span class="trac-field-old">ASIO library has link dependency, even though it claims to be header only</span> → <span class="trac-field-new">Undocumented define causes header-only libraries to have link dependency on system</span> </li> </ul> <p> Fixed by adding: </p> <p> #define BOOST_ERROR_CODE_HEADER_ONLY </p> <p> before including boost headers. </p> <p> Given that this undocumented feature appears to work properly now (outstanding bug seems to have been recently fixed), said feature should probably be documented. </p> <p> Not the problem of ASIO module owner. Changing to documentation. </p> Ticket anonymous Fri, 06 Dec 2013 15:11:38 GMT <link>https://svn.boost.org/trac10/ticket/9472#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9472#comment:3</guid> <description> <p> You should change it to the module which you think it should be documented in. The documentation category isn't for individual library documentation. </p> </description> <category>Ticket</category> </item> <item> <author>soda@…</author> <pubDate>Fri, 06 Dec 2013 15:58:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9472#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9472#comment:4</guid> <description> <p> It's a system-wide setting that affects at least two modules (asio and threads), and probably quite a few more than that. The setting appears to work, it just needs to be included in the various docs on building/linking/header only libraries. Perhaps the 'system' module? I don't know enough about how this project is structured to know where it should go. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 06 Dec 2013 18:12:23 GMT</pubDate> <title>owner, component changed https://svn.boost.org/trac10/ticket/9472#comment:5 https://svn.boost.org/trac10/ticket/9472#comment:5 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Matias Capeletto</span> to <span class="trac-author">Beman Dawes</span> </li> <li><strong>component</strong> <span class="trac-field-old">Documentation</span> → <span class="trac-field-new">system</span> </li> </ul> <p> It should be documented in System library. </p> Ticket