-1
我寫了一個簡單的代碼來測試threading
在C++11
。但我無法在Clion IDE
中運行它,它在紅線中給出以下錯誤。如何在Clion中啓用多線程?
terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted
流程結束,退出代碼爲134
。
了一些關於我的系統細節:
- Linux操作系統Ubuntu 14.10
- C++ 11
我猜的代碼並不重要要解決這個問題,但我把它粘貼在這裏:
#include <iostream>
#include <thread>
using namespace std;
void task1() {
cout << "Task 1::"<<endl;
}
int main() {
thread t1(task1);
t1.join();
return 0;
}
也許你需要指定C++ 11或latet? – kometen
對不起。是的,它是C++ 11。謝謝@kometen – jbsu32