Getting std::thread/mutex to work under Win7 with mingw and g++ 4.7.2 Getting std::thread/mutex to work under Win7 with mingw and g++ 4.7.2 windows windows

Getting std::thread/mutex to work under Win7 with mingw and g++ 4.7.2


These MinGW-w64 builds support C++11 threads,atomic operations etc.

  1. MinGW-builds are now integrated into the MinGW-w64 project
  2. MinGW-builds (project is old and will not be updated, see point above)
  3. MinGW-w64 rubenvb 64-bit and 32-bit builds

Note that MinGW-w64 is not 64-bit only, but does support it, unlike the old MinGW(.org) which is missing quite a lot of the new Vista+ APIs, and of course 64-bit support.


Look also here:https://github.com/meganz/mingw-std-threadsThis is a lighter, native implementation of std::thread and others, without using the win32 port of pthreads.


  1. Go to:https://sourceforge.net/projects/mingw-w64/files/?source=navbar.

  2. Find and download.

MinGW-W64 GCC-8.1.0:

x86_64-posix-seh

  1. Unzip and move to MinGW folder.

    If you are compiling with g++:

  2. Create bash alias to the new g++ bin path ('/mingw/x86_64-8.1.0-release-posix-seh-rt_v6-rev0/mingw64/bin/g++')

  3. Compile using new g++ bin.

    If you are using Cmake:

  4. Create CmakeLists.txt and add:set(CMAKE_CXX_COMPILER /mingw/x86_64-8.1.0-release-posix-seh-rt_v6-rev0/mingw64/bin/g++)

  5. Compile using Cmake/make