【发布时间】:2012-07-27 11:21:20
【问题描述】:
我想执行下面的代码。
#include <iostream>
#include <thread>
void output() {
std::cout << "Hello World" << std::endl;
}
int main()
{
std::thread t(output);
t.join();
return 0;
}
我无法执行它。
Qt Creator 输出 在抛出 'std::system_error' 的实例后调用终止 what(): 不允许操作
但是我可以使用 -pthread 选项在终端上执行。 您能告诉我如何在 Qt Creator 中使用 -pthread 选项吗?
我的开发环境是Ubuntu(12.04)、g++4.6.3、Qt Creator(2.4.1)。
谢谢。
【问题讨论】:
标签: c++ qt c++11 qt-creator