在Mac OS-X 10.5上g ++ 4.6 std :: thread错误

||   我试图在Mac OS-X 10.5上测试gcc4.6的线程库。 我通过macports成功编译并安装了gcc4.6。 但是最简单的并发hello world程序失败了。代码如下:
#include <iostream>  
#include <thread>  

void sayhello() {std::cout << \"Hello\\n\";}  
int main(){  
  std::thread t(sayhello);
  t.join();
}
我尝试编译并使用
g++ -Wall -std=c++0x test.cpp
我得到了错误:
\'thread\' is not a member of \'std\'
您知道导致问题的原因是什么,如何解决? 谢谢!     
已邀请:
不幸的是,从OSX 10.6.8开始的pthreads实现缺少C ++ 0x线程的某些必需功能。在配置过程中,gcc会检测到此情况并禁用对它们的支持。 MacPorts gcc4.5中std :: thread的更多详细信息     

要回复问题请先登录注册