0

Trying to compile code containing c++11 and with g++(provided by Mingw) on windows 7 x64. The part that fails is.

#include <thread>
#include <mutex>
#include <iostream> 
#include <stdlib.h>
#include <Windows.h>
using namespace std;
mutex locka;
thread *threads_a = new thread[20];

Compiling with -std=c++11 and -pthreads. Getting errors:

  • 'mutex' does not name a type
  • 'thread' does not name a type

Any suggestions how to compile this? I need to use C++11 so i can't look at alternatives.

0 Answers0