GCC std::thread not found in namespace std GCC std::thread not found in namespace std multithreading multithreading

GCC std::thread not found in namespace std


Works fine on Linux (g++ -std=c++0x -lpthread with no additional defines).

However, this thread on Cygwin mailing list suggests that, at least as of 4.4, _GLIBCXX_HAS_GTHREADS was disabled by an autoconf test when building libstdc++ because pthread implementation of cygwin is missing pthread_mutex_timedlock. Perhaps MinGW has the same problem.

Also, this thread on comp.lang.c++.moderated says the same thing. Not supported by the library.


What does one do to get C++0x threading support with GCC?

Use Boost? Seriously http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html claims threads aren't complete even in mainline head so it isn't going to be in any current release.


The native Windows builds of gcc do not support the new C++0x/C++11 thread library.

The (commercial) Just::Thread library adds support to the TDM port of gcc 4.5.2 for Windows, as well as MSVC.