std::thread is not a member of namespace std using Eclipse Kepler MinGW

Plain MinGW cannot support std::thread. You will need to use a MinGW-w64 toolchain (such as those shipped with Qt 5) that has “posix” threading enabled, so that libstdc++ exposes the <thread>, <mutex> and <future> functionality.

You can find an installer here, but you can also try just replacing the whole mingw toolchain root folder with one of these packages. You can choose 32- or 64-bit, remember to select threads-posix if you want to play with std::thread and friends. No special compiler options other than the ones you already have are needed. I do suggest using -std=c++11 if you don’t need GCC 4.6 compatibility.

Leave a Comment