Boost C++ Libraries: Ticket #12639: Boost.Spirit + BOOST_DISABLE_THREAD problem https://svn.boost.org/trac10/ticket/12639 <p> While updating the version of Boost used by some older code, I ran into a compiler-error with respect to Boost.Spirit. My code is explicitly defining 'BOOST_DISABLE_THREAD' to avoid linking in the threading library. </p> <p> I tracked down the error to line 13 of <a class="ext-link" href="https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/classic/utility/scoped_lock.hpp"><span class="icon">​</span>https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/classic/utility/scoped_lock.hpp</a> </p> <p> In the latest check-in (July 2015), the "#include &lt;boost/thread/lock_types.hpp&gt;" line was added. This line causes a compile error when 'BOOST_DISABLE_THREAD' is defined. (It indirectly includes other headers which 'require' the Boost.Thread library.) </p> <p> I would blindly suggest that wrapping line 13 in a "#ifndef BOOST_DISABLE_THREAD" seems to solve the problem? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12639 Trac 1.4.3 Nikita Kniazev <nok.raven@…> Thu, 14 Dec 2017 18:31:30 GMT <link>https://svn.boost.org/trac10/ticket/12639#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12639#comment:1</guid> <description> <p> It is pointless to ifdef threads include as it will hide a real problem and you will receive other error if you use <code>scoped_lock</code> with <code>BOOST_DISABLE_THREAD</code>. </p> <p> I guess you use <code>#include &lt;boost/spirit/include/classic.hpp&gt;</code> and it includes <code>boost/spirit/home/classic/utility/scoped_lock.hpp</code> even if <code>BOOST_SPIRIT_THREADSAFE</code> is not defined, so I think it should be fixed like this <a class="ext-link" href="https://github.com/boostorg/spirit/pull/323"><span class="icon">​</span>https://github.com/boostorg/spirit/pull/323</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Sun, 17 Dec 2017 23:45:02 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/12639#comment:2 https://svn.boost.org/trac10/ticket/12639#comment:2 <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> Ticket