Possible Duplicate:
GCC std::thread not found in namespace std
I expected this code to compile under gcc but it didnt. I'm using mingw 4.7.0. I see the header yet the classes dont seem to exist. What flags do i need? i ran it with
g++ -std=gnu++11 main.cpp
The code
#include<atomic>
#include<thread>
#include<iostream>
using namespace std;
atomic<int> a1,a2,a3;
void test(){
cout<<"run";
}
int main(){
thread t(test);
t.join();
}
The error i get is thread doesn't exist. In my other code it also says std::this_thread::yield() doesnt exisit. MSVC11 compiles this fine