在 Ubuntu 13.10 x64 C++11 中创建 std::线程时出错

Error creating std::threads in Ubuntu 13.10 x64 C++11

本文关键字:std 线程 出错 创建 Ubuntu x64 C++11      更新时间:2023-10-16

我不知道我的 Ubuntu 13.10 发生了什么。我所有使用 std::threads 的函数都抛出错误消息:

在抛出"std::system_error"
实例后终止调用 what():不允许操作 中止(核心转储)

同样的程序在 Ubuntu 13.04 64 和 32 位中完美运行......我没有更改 Makefile 中的 g++ 参数。这似乎是Ubuntu 13.10 x64的错误。

谁能帮我?

(对不起,我的英语不好)

编译时很可能缺少 -phtread 开关。如果在单独的步骤中进行链接,则需要将开关 -lpthread 添加到命令行中。