简体   繁体   中英

How do I upgrade from POSIX to <threads.h>, C11 standard?

Switching my C program from pthreads, POSIX , <pthread.h> to the C11 standard <threads.h>.

Im on a MAC from 2019. Below is my error and my gcc -version output.

How do I upgrade to use <threads.h>?

Question's from 7 years ago say that it is not supported, is this still the case and why not support a 'standard'?

Error message:

ruby.c:5:10: fatal error: 'threads.h' file not found #include <threads.h>

gcc --version

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 11.0.0 (clang-1100.0.33.17) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

You don't, Posix is the standard. Thanks friends.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM