Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有谁知道如何覆盖 Linuxbrew 查找 gcc 编译器的默认位置?我问的系统有 gcc 4.1.2,而 Linuxbrew 需要 4.2。我已经能够获得另一个 gcc 编译器的二进制文件,并希望将 Linuxbrew 指向该二进制文件。
我将 gcc 编译器的路径添加到我的 $PATH 中,但是当尝试运行 brew install 公式时,它仍然引用 /usr/bin/gcc。
环顾四周,我找不到答案。如果有任何有用的想法。谢谢,
原答案:
brew install some_package --cc=your_desired_cc
基于评论的完整答案:
export PATH=<path-to-desired-cc>:$PATH brew install <some_package> --cc=gcc