所以我试着用线程运行一个简单的hello world程序。这是一个标准的hello world程序,用于向您介绍线程。我在Ubuntu14.04上使用代码::块IDE,我有gcc 4.8.2。我使用GCC编译器构建我的项目,我还检查了选项‘`Have g++遵循C++11 ISO C++语言标准-std=c++11’,但是当我构建该项目时,我得到了以下错误:
`terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted`我看到了一些解决方案,告诉我应该在某个地方添加-pthread和-lthread,但是我不知道该在哪里写这个.有什么帮助吗?
发布于 2015-02-06 11:44:03
在链接器选项中添加"-pthread“(”链接器设置“→”其他链接器选项“)。
code blocks pthread的首个谷歌结果)https://stackoverflow.com/questions/28364754
复制相似问题