当前位置:   article > 正文

c++报terminate called after throwing an instance of 'std::system_error' what(): Unknown error -1错误_what(): unknown error -1 aborted (core dumped)

what(): unknown error -1 aborted (core dumped)

在线程编程时,编译器报

terminate called after throwing an instance of 'std::system_error'
terminate called recursively
  what():  Unknown error -1
Aborted (core dumped)
解决方法:在链接时,加上 -pthread选项。g++ -std=c++11 -pthread thread_demo.cpp -o demo。

clion编译时,会报这种错误。需要在CMakeLists.txt修改编译选项。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/51627
推荐阅读
相关标签
  

闽ICP备14008679号