Gcc

在 OpenBSD 上 pkg_add gcc 之後沒有 gcc 執行檔

  • April 7, 2022

我從 OpenBSD 6.5 上的包中安裝了 gcc

# pkg_add gcc-8.3.0

gcc 相關文件安裝在/usr/local/lib/,但沒有找到 gcc 執行檔。

# gcc -bash: gcc: command not found

(我知道 Clang 常用於 OpenBSD,但我想將 gcc 用於項目)

從包中egcc安裝GNU C 編譯器執行檔時會呼叫它。在(基本系統的,至少在 amd64 上)中gcc還應該有一個gcc執行檔。/usr/bin``gcc

$ type egcc gcc
egcc is /usr/local/bin/egcc
gcc is /usr/bin/gcc
$ gcc --version
gcc (GCC) 4.2.1 20070719
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ egcc --version
egcc (GCC) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

請注意,它gcc已於 2021 年末(OpenBSD 7.0)從 amd64 上的 OpenBSD 基礎系統中刪除。

引用自:https://unix.stackexchange.com/questions/554752