【发布时间】:2023-08-31 21:24:02
【问题描述】:
我有一个 pthreads 程序。我必须在 Linux 中使用 gcc -pthread (-pthreads 是无法识别的选项)和 Sun 中的 gcc -pthreads (-pthread 是无法识别的选项)来编译它。为什么有区别,因为它是相同的编译器?但是,-lpthread 对两者都有效,但我听说这并不总是足够的。
【问题讨论】:
-
不是编译器的函数,是库的实现函数。
标签: gcc compiler-construction pthreads portability