I'm trying to use the C11 standard threading in my program, and I'm using the Mingw-w64 toolchain x86_64-8.1.0-posix-seh-rt_v6-rev0
specifically.
When I #include <threads.h>
as the C11 standard defines, I get the No such file or directory
error from gcc. I have found that I can #include <pthread.h>
without error. I am passing the -std=c11
argument to gcc
, btw.
I've searched high and low on the internet for any information about the standard C threading support. All I can find information on is for C++. Can somebody please explain to me why I can't use the C11 standard threads.h
library?
EDIT: I've also checked if the STDC_NO_THREADS macro is defined. It seems to be undefined.
#ifdef __STDC_NO_THREADS__
printf("We got no threads capp'n!\n");
#endif
I get no message about not having threads.
mingw64
builds againstmsvcrt
and notglibc
. Check for the__STDC_NO_THREADS__
macro and if it's defined. – Anticoagulant