Boost C++ Libraries: Ticket #7347: duplicate symbol while BOOST_ERROR_CODE_HEADER_ONLY is defined https://svn.boost.org/trac10/ticket/7347 <p> Even if BOOST_ERROR_CODE_HEADER_ONLY is not documented I wanted to report this defect. </p> <p> When I define BOOST_ERROR_CODE_HEADER_ONLY building Boost.Thread I get the following error: </p> <pre class="wiki">ld: duplicate symbol boost::system::system_category() in ../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/future.o and ../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/pthread/thread.o for architecture x86_64 collect2: ld returned 1 exit status "g++" -dynamiclib -Wl,-single_module -install_name "libboost_thread.dylib" -o "../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/libboost_thread.dylib" "../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/pthread/thread.o" "../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/pthread/once.o" "../../../bin.v2/libs/thread/build/darwin-4.2.1/debug/threading-multi/future.o" -headerpad_max_install_names -g </pre><p> </p> <p> I guess that you need to declare the following functions inline. </p> <pre class="wiki"> BOOST_SYSTEM_DECL const error_category &amp; system_category(); BOOST_SYSTEM_DECL const error_category &amp; generic_category(); </pre><p> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7347 Trac 1.4.3 viboes Sat, 08 Sep 2012 15:45:56 GMT summary changed https://svn.boost.org/trac10/ticket/7347#comment:1 https://svn.boost.org/trac10/ticket/7347#comment:1 <ul> <li><strong>summary</strong> <span class="trac-field-old">BOOST_ERROR_CODE_HEADER_ONLY</span> → <span class="trac-field-new">duplicate symbol while BOOST_ERROR_CODE_HEADER_ONLY is defined</span> </li> </ul> Ticket viboes Sat, 08 Sep 2012 15:47:36 GMT attachment set https://svn.boost.org/trac10/ticket/7347 https://svn.boost.org/trac10/ticket/7347 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">7347.patch</span> </li> </ul> <p> Simple patch that solves my issue. OK to commit? </p> Ticket viboes Sat, 08 Sep 2012 15:48:01 GMT cc set https://svn.boost.org/trac10/ticket/7347#comment:2 https://svn.boost.org/trac10/ticket/7347#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">viboes</span> added </li> </ul> Ticket viboes Sat, 08 Sep 2012 17:23:19 GMT attachment set https://svn.boost.org/trac10/ticket/7347 https://svn.boost.org/trac10/ticket/7347 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">7347_2.patch</span> </li> </ul> <p> Needed to run the Boost.Thread test if BOOST_ERROR_CODE_HEADER_ONLY is defined </p> Ticket viboes Sat, 08 Sep 2012 17:26:30 GMT <link>https://svn.boost.org/trac10/ticket/7347#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7347#comment:3</guid> <description> <p> The fact that the boost/../libs/system/src/error_code.cpp introduce too much symbols because of the using statements has as consequence. </p> <pre class="wiki">test_7328.cpp: In function ‘void f()’: test_7328.cpp:26: error: reference to ‘interrupted’ is ambiguous test_7328.cpp:13: error: candidates are: bool interrupted ../../../boost/system/error_code.hpp:84: error: boost::system::errc::errc_t boost::system::errc::interrupted </pre><p> The patch 7347_2 contribute to solve these issues. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 09 Dec 2012 14:37:06 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7347#comment:4 https://svn.boost.org/trac10/ticket/7347#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> It seems to me that these patches have been applied without closing the ticket. </p> Ticket