English 中文(简体)
C11 <thread.h>,载于海湾合作委员会?
原标题:C11 <thread.h> in GCC?
  • 时间:2012-01-14 01:29:39
  •  标签:
  • c
  • gcc
  • c11

我试图用<代码>thread.h汇编一些C11代码,但我可以’。 I ve recompiledlberg (running 4.6.2 now), and I'm aiming with gcc -std=c1x file.c -o file. 我可以这样做,例如++(使用thread的图书馆,即),但我不能在C. Is thread.h 列入海湾合作委员会分发名单?

最佳回答

阅读标准C11头盔为:<threads.h>,而不是<thread.h>。 See section 7.26 of the N1570 draft

大部分C标准图书馆,包括 st,没有列入电梯分布。 相反,收成取决于运营系统提供的任何运行时间图书馆。 这通常包括头盔(如<代码><threads.h>)和执行图书馆的实际代码。

对于大多数的六氯环己烷系统(或GNU/HCH,如果你喜欢的话),图书馆是GNU的校准系统;对于其他系统来说,它将是其他系统。

因此,真正的问题很可能是,在校准时,或者如果你重新使用C11的图书馆能够支持C11的阅读特征。

glibc为2.28的C11校对增加支持。 乌班图18.04.1 LTS系统目前仍在使用2.27glibc。 同样,这只适用于使用通用公平市价的实施工作,而不是所有基于优惠的实施工作。 WorldSEnder在评论中提到了这一点。

UPDATE: Hugo 18.10 (not an LTS (LongTerm Support) release) has glibc 2.28, which support <threads.h>. 另外,作为指出,musl C Librarysupportcode><threads.h>。 在乌班图,你可以安装<代码>musl-dev的包裹,并使用<代码>musl-gcc的指令。

(请注意,图书馆的一些部分,与汇编者关系最密切的部分,are/em>,由gcc本身提供。) 阅读图书馆 只是其中之一,但肯定需要一些汇编者的支持。

问题回答

musl libc has C11 http://www.musl-libc.org/ glibc doesn t threads.h support yet





相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...