我用brew install gcc安装了gcc-6
这将在/usr/local/Cellar/gcc/6.3.0_1/bin/gcc-6中安装gcc-6
但是,命令ggc -v将返回:
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.0.0 (clang-800.0.42.1) Target: x86_64-apple-darwin16.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
这仍然是xcode默认的"gcc“,这真的很轰动。所以我需要把gcc和gcc-6联系起来。我已经试过brew link gcc了。感谢您的任何意见!
编辑:如果有帮助,echo $PATH将返回/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
发布于 2017-02-21 06:26:52
解决了!
在$PATH的前面添加了usr/local/bin,然后添加了ln -s gcc-6 gcc
https://stackoverflow.com/questions/42354964
复制相似问题