PATH not searched properly for gcc version

Turner, Adrian Keith akt at
Tue Jul 3 17:02:43 UTC 2018

Dear Macports users,

I am running OSX version 10.12.6 and MacPorts 2.5.2. I have installed
version 7 of gcc with MacPorts:

/opt/local/bin/gcc --version
gcc (MacPorts gcc7 7.3.0_1) 7.3.0

When I just use "gcc" for the command however I get the OSX
pre-installed version:

gcc --version
Configured with: --prefix=/Applications/
Apple LLVM version 9.0.0 (clang-900.0.39.2)

However, my PATH environment variable is set up to find the MacPorts one

printenv PATH

Also, interesting are the results of which and whereis:
which gcc
whereis gcc

How do I make my system find the correct version of gcc without
specifying the full path?

Many thanks
Adrian Turner

More information about the macports-users mailing list