gpt4 book ai didi

gcc - gcc 选项 -pthread 是什么意思?

转载 作者:行者123 更新时间:2023-12-02 00:51:04 26 4
gpt4 key购买 nike

我花了很多时间来查找所有 gcc 选项的文档。我在 ubuntu 机器上,所以甚至不确定这是否与我相关。

来自这个 make 规则:

my-server: my-server.c
$(CC) -Wall -pthread my-server.c -o my-server

我找到了这个选项摘要: https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Option-Summary.html

最佳答案

来自 man gcc

-pthread

Add support for multithreading using the POSIX threads library. This option sets flags for both the preprocessor and linker. It does not affect the thread safety of object code produced by the compiler or that of libraries supplied with it. These are HP-UX specific flags.

请注意,它不同于-lpthread-lpthread 选项不设置预处理器标志。例如宏_REENTRANT__USE_REENTRANT

关于gcc - gcc 选项 -pthread 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39782602/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com