I\'m trying to compile a simple c++ program that uses std::thread on eclipse kepler / mingw 4.8.1 and win32. I hope to move development to linux at some point after many ye
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
,
and
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.