MacOS – brew not linking gcc after install

gcchomebrewmacosopen source

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?

Best Answer

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