what(): Enable multithreading to use std::thread: Operation not permitted

在linux 使用 C++11 thread 使会出现以下问题:

Starting: /home/hansry/Code/Algorithm_design/chess/bin/chess
terminate called after throwing an instance of 'std::system_error'
  what():  Enable multithreading to use std::thread: Operation not permitted
Spawning 3 threads...
*** Crashed with return code: 0 ***

在 CMakeLists 中添加以下命令即可:

set(CMAKE_CXX_FLAGS "-std=c++11 -pthread ")

猜你喜欢

转载自blog.csdn.net/hansry/article/details/79560317