id summary reporter owner description type status milestone component version severity resolution keywords cc 10942 Boost.Thread fails to build on Cygwin Peter Dimov Steven Watanabe "By default on Cygwin, the Boost.Thread headers choose the POSIX API. This decision is made in `boost/thread/detail/platform.hpp`: {{{ #if defined(BOOST_THREAD_POSIX) # define BOOST_THREAD_PLATFORM_PTHREAD #else # if defined(BOOST_THREAD_WIN32) # define BOOST_THREAD_PLATFORM_WIN32 # elif defined(BOOST_HAS_PTHREADS) # define BOOST_THREAD_PLATFORM_PTHREAD # else # error ""Sorry, no boost threads are available for this platform."" # endif #endif }}} In the Cygwin case, neither `BOOST_THREAD_POSIX` nor `BOOST_THREAD_WIN32` appear to be defined, but `BOOST_THREAD_CYGWIN`, so the logic above chooses `BOOST_THREAD_PLATFORM_PTHREAD`. This is actually correct, in my opinion; Cygwin is a POSIX platform. However, the Jamfile by default chooses Win32 on Cygwin: {{{ local rule default_threadapi ( ) { local api = pthread ; if [ os.name ] = ""NT"" { api = win32 ; } return $(api) ; } }}} which later results in a bunch of errors when `win32/thread.cpp` is compiled against `pthread/thread_data.hpp` et al. So, either the default in `platform.hpp` should be changed to Win32 under Cygwin, or (better) the default `threadapi` in the Jamfile should be changed to `pthread` under Cygwin. Manually specifying `threadapi=pthread` is not a particularly good option, because Boost.Thread is a dependency of some tests, and when {{{ b2 toolset=gcc,gcc-cxx11,clang,clang-cxx11,msvc-8.0,msvc-10.0,msvc-11.0,msvc-12.0 }}} (for example) is invoked to test a library, `threadapi=pthread` is not possible." Bugs new To Be Determined build Boost 1.57.0 Problem