हैलो मैं सी ++ 11 में धागे के साथ समस्या है। मेरे पास g ++ 4.8.1 के साथ उबंटू 64 बिट 13.10 (परीक्षण) है। मैं कोड संकलन करने की कोशिश की: -std = C++ 11 -pthread -lpthread:सी ++ 11 धागा त्रुटि क्रम
#include <thread>
void func()
{
// do some work
}
int main()
{
std::thread t(func);
t.join();
return 0;
}
विकल्पों के साथ
। संकलन सफल रहा था, लेकिन जब मैं इसे चलाने के लिए कोशिश की, मैं एक त्रुटि प्राप्त किया है:
terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted
क्या आप -pthread -std = C++ 11 के साथ प्रयास कर सकते हैं? (-lpthread के बिना) – sphair
लगता है अन्य लोगों को इस मुद्दे https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201 – log0