Ciao Ho problema con fili in C++ 11. Ho Ubuntu 64 bit 13.10 (test) con g ++ 4.8.1. ho provato a compilare il codice:C++ 11 filettatura errore di runtime
#include <thread>
void func()
{
// do some work
}
int main()
{
std::thread t(func);
t.join();
return 0;
}
con le opzioni: -std = C++ 11 -pthread -lpthread. Compilation ha avuto successo, ma quando ho provato a farlo funzionare, ho ricevuto un errore:
terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted
Potresti provare con -pthread -std = C++ 11? (Senza -lpthread) – sphair
Sembra che le altre persone hanno questo problema https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201 – log0