2

Why does brew not link gcc properly? What am I missing?

$>brew install gcc49 --without-multilib
==> Installing gcc49 from homebrew/homebrew-versions
==> Downloading http://ftpmirror.gnu.org/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2
==> Downloading from http://gnu.mirror.iweb.com/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2
######################################################################## 100.0%
==> ../configure --build=x86_64-apple-darwin13.4.0 --prefix=/usr/local/Cellar/gcc49/4.9.3 --libdir=/usr/local/Cellar/gcc49/4.9.3/lib/gc
==> make bootstrap
==> make install
🍺  /usr/local/Cellar/gcc49/4.9.3: 1079 files, 146M, built in 27.3 minutes
$>which gcc49   // <--------- NOTHING SHOWS UP HERE
$>which gcc  // <--------- NOTHING SHOWS UP HERE
$>

I event tried brew unlink gcc49 && brew link gcc49 What am I missing?

3
  • When you do the brew link & unlink commands, what does it say? Nov 20, 2015 at 22:29
  • Already linked. ok looks like the executables are named gcc-4.9 and not gcc.
    – A.D
    Nov 20, 2015 at 22:31
  • if you fixed your problem, then create an answer saying what you did, and mark it as solved. Nov 20, 2015 at 22:33

2 Answers 2

1

The executables are named gcc-4.9 and not gcc I fixed it by going to:

$>cd /usr/local/Cellar/gcc49/4.9.3/bin
$>ln -s gcc-4.9 gcc
$>ln -s g++-4.9 g++
$> cd ~
$>brew link gcc
1
  • don't you mean ln -s instead of ln -x?
    – user115423
    Aug 17, 2017 at 19:07
0

I believe all the homebrew gcc variants don't get linked as gcc. You could look in /usr/local/bin and sort by time or check in the /usr/local/Cellar/gcc49/4.9.3/bin folder where the binaries all actually get built as opposed to sym linked to /usr/local/bin

ls -lrt /usr/local/bin | tail -20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .