在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\'
您知道导致问题的原因是什么,如何解决?
谢谢!
没有找到相关结果
已邀请:
1 个回复
貉骂