Search code examples
gccpathhomebrewreinstall

Can't find the right GCC


GCC was reinstalled on my mac through brew, but when I did which gcc, it returned /usr/bin/gcc, instead of /usr/local/bin/gcc.

I restarted my computer, but it did not help. echo $PATH returns:

/Users/myname/anaconda/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin

Solution

  • The reason is brew install gcc does not create gcc binary, but gcc-7