Boost C++ Libraries: Ticket #7335: Using Boost.Pool requires to link with Boost.System https://svn.boost.org/trac10/ticket/7335 <p> Boost.Pool documentation says: </p> <blockquote> <p> The Boost Pool library is a header-only library. That means there is no .lib, .dll, or .so to build; just add the Boost directory to your compiler's include file path, and you should be good to go! </p> </blockquote> <p> But in fact, in boost 1.51.0 on my system (ALT Linux x86_64) it uses Boost.Thread parts which bring Boost.System in, and thus I get the following linking error: </p> <pre class="wiki">$ cat a.cpp #include &lt;boost/pool/pool_alloc.hpp&gt; int main() { return 0; } $ g++ a.cpp /tmp/.private/iv/ccqf3pLa.o: In function `__static_initialization_and_destruction_0(int, int)': a.cpp:(.text+0x4a): undefined reference to `boost::system::generic_category()' a.cpp:(.text+0x56): undefined reference to `boost::system::generic_category()' a.cpp:(.text+0x62): undefined reference to `boost::system::system_category()' collect2: ld returned 1 exit status </pre><p> Of course, adding -lboost_system helps. </p> <p> Not shure if it is Boost.Pool, Boost.Thread or just Boost.Pool documentation bug. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7335 Trac 1.4.3 Kohei Takahashi <flast@…> Wed, 10 Oct 2012 09:08:59 GMT cc set https://svn.boost.org/trac10/ticket/7335#comment:1 https://svn.boost.org/trac10/ticket/7335#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">flast@…</span> added </li> </ul> <p> This bug caused by <a class="changeset" href="https://svn.boost.org/trac10/changeset/76543" title=" * [@http://svn.boost.org/trac/boost/ticket/2741 #2741] Proposal to ...">r76543</a>. </p> <p> New dependencies tree: </p> <pre class="wiki">pool/detail/mutex.hpp -&gt; thread/mutex.hpp -&gt; thread/(pthread|win32)/mutex.hpp -&gt; thread/exceptions.hpp -&gt; system/error_code.hpp </pre> Ticket Ivan A. Melnikov <iv@…> Wed, 10 Oct 2012 09:24:36 GMT <link>https://svn.boost.org/trac10/ticket/7335#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7335#comment:2</guid> <description> <p> As far as I know, Boost.Thread never promised to be header-only or have header-only parts. Thus, using mutex from Boost.Thread and claiming to be header-only seems to me... erm... a bit unfair, even if it used to work somehow. </p> <p> I think the best solution would be to switch to using &lt;boost/detail/lightweight_mutex.hpp&gt;, as it is header only and does not have any extra dependencies. </p> </description> <category>Ticket</category> </item> <item> <author>vslavik@…</author> <pubDate>Mon, 25 Feb 2013 17:43:20 GMT</pubDate> <title>cc changed https://svn.boost.org/trac10/ticket/7335#comment:3 https://svn.boost.org/trac10/ticket/7335#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">vslavik@…</span> added </li> </ul> Ticket bimargulies@… Sat, 08 Jun 2013 14:40:23 GMT cc changed https://svn.boost.org/trac10/ticket/7335#comment:4 https://svn.boost.org/trac10/ticket/7335#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">bimargulies@…</span> added </li> </ul> <p> Is there any way around this to disable the use of the mutex? </p> Ticket manuel.freiberger@… Wed, 07 Aug 2013 18:09:03 GMT <link>https://svn.boost.org/trac10/ticket/7335#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7335#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7335#comment:4" title="Comment 4">bimargulies@…</a>: </p> <blockquote class="citation"> <p> Is there any way around this to disable the use of the mutex? </p> </blockquote> <p> I also stumbled across this bug. The pool library pulls the header &lt;boost/thread/mutex.hpp&gt; even if the user has defined BOOST_NO_MT or BOOST_POOL_NO_MT. </p> <p> It would be good to change line 13 of &lt;boost/thread/mutex.hpp&gt; from #ifdef BOOST_HAS_THREADS to #if defined(BOOST_HAS_THREADS) &amp;&amp; !defined(BOOST_NO_MT) &amp;&amp; !defined(BOOST_POOL_NO_MT) (this is the complement of the expression from line 32). </p> <p> This would allow to use Boost.Pool without depending on Boost.System. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Tue, 18 Mar 2014 15:21:28 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7335#comment:6 https://svn.boost.org/trac10/ticket/7335#comment:6 <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">duplicate</span> </li> </ul> <p> This is a duplicate of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7085" title="#7085: Bugs: Boost pool library it not header only as claimed in documentation (closed: fixed)">#7085</a> </p> Ticket