std::thread run time error "Enable multithreading to use std::thread: Operation not permitted"
I am trying to port a program that was running without any problem when the environment set up was Ubuntu 12.0 QTCreator Version - 2.4.1 QT - 4.8.0 gcc - 4.6.3 to a new environment
Ubuntu 14.04 QTCreator Version - 3.0.1 QT - 5.2.1 gcc - 4.8
Unfortunately I end up seeing a runtime error "terminate called after throwing an instance of 'std::system_error' what(): Enable multithreading to use std::thread:Operation not permitted"
As per my understanding this seems to be an issue with compiler compatibility. Either I miss some options during compilations or a bug from compiler.
How to get his fixed? Any help is greatly appreciated.
21 Answer
gcc 4.8 had a bug related to this. You could try the workaround mentioned in the bug report: Add the flags
-Wl,--no-as-neededto the compilation.