1

将我的 C 程序从 pthreads、POSIX、<pthread.h> 切换到 C11 标准 <threads.h>。

我在 2019 年的 MAC 上。下面是我的错误和我的 gcc -version 输出。

如何升级以使用 <threads.h>?

7年前的问题说它不受支持,现在仍然如此吗?为什么不支持“标准”?

错误信息:

ruby.c:5:10:致命错误:找不到“threads.h”文件#include <threads.h>

gcc --version

配置: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang 版本11.0.0 (clang-1100.0.33.17) 目标:x86_64-apple-darwin19.6.0 线程模型:posix InstalledDir:/Library/Developer/CommandLineTools/usr/bin

4

1 回答 1

1

你不知道,Posix 是标准。谢谢朋友。

于 2020-09-08T15:30:42.970 回答