2017-02-20 79 views
1

到GCC-6 I裝gcc-6使用brew install gcc鏈接GCC使用釀造

此裝gcc-6 /usr/local/Cellar/gcc/6.3.0_1/bin/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。任何輸入是讚賞!

編輯:如果它可以幫助

+1

'LN -s的/ usr/local/bin中/ GCC-6的/ usr/local/bin中/ gcc' –

回答

1

解決echo $PATH返回/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

加入usr/local/bin到$ PATH的前部,然後ln -s gcc-6 gcc