0

I installed gcc version 4.9 with homebrew in my mac. But when I check the gcc version in terminal it is showing still the old one.

Aarons-MacBook-Air:bin Aaron$ gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.1.0 Thread model: posix 

Please help

1
  • 2
    by default homebrew installs the compiler with a version postfix, so it's called gcc-4.9, so as not to interfere with the system provided compiler. Commented Feb 27, 2015 at 13:17

1 Answer 1

2

homebrew installs gcc with version specific suffixes, so when you install gcc49, it gets called gcc-4.9 on the command line. This is intended to prevent interference with the gcc stub (which is actually clang) which is provided by the OSX command line development toolchain, as well as to allow you to install gcc-4.8, gcc-4.7, etc. alongside each other.

Generally defining the environment variables CC=gcc-4.9 and CXX=g++-4.9 should allow you to compile autoconf based packages, as well as standard makefile based projects using the gcc-4.9 compiler, rather than using the default cc/gcc.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.