Boost C++ Libraries: Ticket #5134: [thread] Simple, all sources, compile fails https://svn.boost.org/trac10/ticket/5134 <p> If I try to do a simple/dumb compile I get errors because some source files assume that they will only be compiled in a particular platform/API. By simple/dumb I mean going to my build system, whatever that might be, and adding all the files under the <code>libs/thread/src/*.cpp</code> &amp; <code>libs/thread/src/*/*.cpp</code>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5134 Trac 1.4.3 viboes Wed, 11 May 2011 05:21:21 GMT type changed https://svn.boost.org/trac10/ticket/5134#comment:1 https://svn.boost.org/trac10/ticket/5134#comment:1 <ul> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Support Requests</span> </li> </ul> <p> Please, could you provide more information so we can help you. I have moved to support request until you give the exact error and context. </p> Ticket viboes Sat, 03 Dec 2011 00:11:17 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5134#comment:2 https://svn.boost.org/trac10/ticket/5134#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">worksforme</span> </li> </ul> <p> Closed by missing details. </p> Ticket René Rivera Sat, 03 Dec 2011 04:26:15 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/5134#comment:3 https://svn.boost.org/trac10/ticket/5134#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">worksforme</span> </li> </ul> <p> Sorry for the very delayed response.. Didn't see the trac email about this. </p> <p> I'm not sure how much more detail I can give other than I was trying to compile for iOS at the time. Simply put one can't compile the libs/thread/src/win32/*.cpp files when compiling for something other than a Windows target as it includes and references Windows specific headers and definitions. </p> <p> Please note that I said "my build system". I.e. I'm not talking about building with BBv2 and the libs/thread/build/Jamfile.v2. </p> Ticket viboes Sun, 04 Dec 2011 00:30:40 GMT owner, status changed; cc set https://svn.boost.org/trac10/ticket/5134#comment:4 https://svn.boost.org/trac10/ticket/5134#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">viboes</span> added </li> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">new</span> </li> </ul> <p> How do you expect that we solve this issue, if it is one? </p> Ticket René Rivera Sun, 04 Dec 2011 01:47:59 GMT <link>https://svn.boost.org/trac10/ticket/5134#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5134#comment:5</guid> <description> <p> A common solution is to #ifdef (based on the platform) the source files so that they end up mostly empty. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 09 Dec 2011 18:09:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5134#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5134#comment:6</guid> <description> <p> Please, could you post the error you find and the command line used to get these errors? Otherwise we are unable to help you. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>René Rivera</dc:creator> <pubDate>Thu, 15 Dec 2011 04:13:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5134#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5134#comment:7</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5134#comment:6" title="Comment 6">viboes</a>: </p> <blockquote class="citation"> <p> Please, could you post the error you find and the command line used to get these errors? Otherwise we are unable to help you. </p> </blockquote> <p> Sure.. Here's a simple example: </p> <pre class="wiki">Froggy:trunk grafik$ uname -a Darwin Froggy.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64 Froggy:trunk grafik$ g++ --version i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Froggy:trunk grafik$ pwd /Users/grafik/devroots/Boost/trunk Froggy:trunk grafik$ cat thread_compile_test.cpp #include &lt;boost/thread.hpp&gt; int main() { return 0; } Froggy:trunk grafik$ g++ -I. thread_compile_test.cpp libs/thread/src/*.cpp libs/thread/src/*/*.cpp libs/thread/src/win32/thread.cpp:13:21: error: process.h: No such file or directory libs/thread/src/win32/thread.cpp:22:21: error: windows.h: No such file or directory libs/thread/src/win32/thread.cpp:30: error: ‘DWORD’ does not name a type libs/thread/src/win32/thread.cpp: In function ‘void boost::&lt;unnamed&gt;::create_current_thread_tls_key()’: libs/thread/src/win32/thread.cpp:34: error: ‘tss_cleanup_implemented’ was not declared in this scope libs/thread/src/win32/thread.cpp:35: error: ‘current_thread_tls_key’ was not declared in this scope libs/thread/src/win32/thread.cpp:35: error: ‘TlsAlloc’ was not declared in this scope libs/thread/src/win32/thread.cpp:40: error: ‘TLS_OUT_OF_INDEXES’ was not declared in this scope libs/thread/src/win32/thread.cpp: In function ‘void boost::&lt;unnamed&gt;::cleanup_tls_key()’: libs/thread/src/win32/thread.cpp:46: error: ‘current_thread_tls_key’ was not declared in this scope libs/thread/src/win32/thread.cpp:48: error: ‘TlsFree’ was not declared in this scope libs/thread/src/win32/thread.cpp: In function ‘boost::detail::thread_data_base* boost::&lt;unnamed&gt;::get_current_thread_data()’: libs/thread/src/win32/thread.cpp:55: error: ‘current_thread_tls_key’ was not declared in this scope libs/thread/src/win32/thread.cpp:59: error: ‘current_thread_tls_key’ was not declared in this scope libs/thread/src/win32/thread.cpp:59: error: ‘TlsGetValue’ was not declared in this scope libs/thread/src/win32/thread.cpp: In function ‘void boost::&lt;unnamed&gt;::set_current_thread_data(boost::detail::thread_data_base*)’: libs/thread/src/win32/thread.cpp:65: error: ‘current_thread_tls_key’ was not declared in this scope libs/thread/src/win32/thread.cpp:66: error: ‘TlsSetValue’ was not declared in this scope libs/thread/src/win32/thread.cpp: At global scope: libs/thread/src/win32/thread.cpp:76: error: expected `)' before ‘*’ token libs/thread/src/win32/thread.cpp:77: error: ‘func’ does not name a type libs/thread/src/win32/thread.cpp:79: error: expected `)' before ‘start_address’ libs/thread/src/win32/thread.cpp:82: error: ‘DWORD’ does not name a type libs/thread/src/win32/thread.cpp:91: error: expected `)' before ‘*’ token libs/thread/src/win32/thread.cpp:91: error: expected ‘,’ or ‘...’ before ‘*’ token libs/thread/src/win32/thread.cpp:91: error: ‘_beginthreadex’ declared as function returning a function libs/thread/src/win32/thread.cpp:92: error: expected unqualified-id before ‘void’ libs/thread/src/win32/thread.cpp:631: error: expected `}' at end of input libs/thread/src/win32/thread.cpp:631: error: expected `}' at end of input Froggy:trunk grafik$ </pre><p> Same applies for just about anywhere you try the equivalent simple operation. </p> <p> HTH. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 18 Dec 2011 13:32:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5134#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5134#comment:8</guid> <description> <p> Depending on the target, the files that must be compiled and the compiler flags are different (see libs/boost/build/Jamfile) </p> <pre class="wiki"> alias thread_sources : ## win32 sources ## win32/thread.cpp win32/tss_dll.cpp win32/tss_pe.cpp : ## requirements ## &lt;threadapi&gt;win32 ; alias thread_sources : ## pthread sources ## pthread/thread.cpp pthread/once.cpp : ## requirements ## &lt;threadapi&gt;pthread ; </pre><p> You will need to add at least the define BOOST_THREAD_POSIX and BOOST_THREAD_USE_LIB. </p> <p> BTW, why do you want to do this? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 29 Dec 2011 12:42:23 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5134#comment:9 https://svn.boost.org/trac10/ticket/5134#comment:9 <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">invalid</span> </li> </ul> <p> Closed, as Boost don't need to support this neither document which sources must be compiled other than the explicit build/Jamfile. </p> Ticket anonymous Tue, 10 Nov 2015 11:39:15 GMT <link>https://svn.boost.org/trac10/ticket/5134#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5134#comment:10</guid> <description> <p> Because of this, it's impossible to compile for Android using BOOST_ALL_NO_LIB. I don't know why boost permanently makes my life a nightmare. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 10 Nov 2015 18:41:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5134#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5134#comment:11</guid> <description> <p> Because you have no name I don't see the need to replay :) </p> </description> <category>Ticket</category> </item> </channel> </rss>