g++4.6 std::thread error on Mac OS-X 10.5
#include <iostream>
#include <thread>
void sayhello() {std::cout << "Hello\n";}
int main(){
std::thread t(sayhello);
开发者_如何学Pythont.join();
}
I tried to compile and used g++ -Wall -std=c++0x test.cpp
I got the error:
'thread' is not a member of 'std'
Any idea what cause the problem and how can I fix it? Thanks!
Unfortunately, pthreads implementation as of OSX 10.6.8 lacks some required features for C++0x threads. During configure, gcc detects this and disable support for them. More details at std::thread in MacPorts gcc4.5
精彩评论