Como fazer o CDT / Eclipse funcionar com encadeamentos C ++ 11?
Eu tentei testar um exemplo de threads C ++ 11 no Eclipse. Mas recebi esta mensagem ao executar o programa:
terminate chamado depois de lançar uma instância de 'std :: system_error' what (): Operation not allowed '
Meu sistema: ubuntu + gcc 4.7
Programa:
<code>#include <iostream> #include <thread> void worker() { std::cout << "hello from worker" << std::endl; } int main(int argc, char **argv) { std::thread t(worker); t.join(); } </code>
... e sim, eu coloquei-std=c++11
e-pthread
dentroC/C++ Build -> Settings -> Tool Settings -> Cross G++ Compiler -> Miscellaneous -> Other Flags
.
Algum comentário?