C11 GCC threads.h not found?

Following code

#include <threads.h> 

Gives me this error:

 fatal error: threads.h: No such file or directory 

Using the latest GCC and Clang with -std = c11.

Are C11 streams not supported by GCC and Clang? Or is there a hack (or something to install) to get it? I just use Ubuntu 14.04 with gcc and clang packages from the Ubuntu repository.

+22
c multithreading c11
Apr 05 '14 at 1:33
source share
3 answers

The gcc document status C11 indicates that it does not support streams, it says:

Threading [Optional] | The problem with the library (not implemented)

As the document points out, this is not a gcc or clang problem, but glibc . As Zack noted, it looks like work can be started soon to get support for this in glibc , but it will not help you now, you can use this in the meantime.

+20
Apr 05 '14 at 1:40
source share

Musl support for C11 <threads.h> .

On Debian, install musl-tools , and then compile with musl-gcc . I am working on downloading Debian with Musl instead of Glibc.

Also see this .

+4
Apr 12 '15 at 1:45
source share

While C11 streams are not yet implemented, C ++ 11 streams are implemented and have similar functionality. Of course, C ++ 11 might not be an acceptable solution, in which case your best comments about POSIX streams are your best hope.

+1
Sep 18 '14 at 21:17
source share



All Articles