PATH not searched properly for gcc version

Rainer Müller raimue at macports.org
Tue Jul 3 17:40:11 UTC 2018


On 2018-07-03 19:02, Turner, Adrian Keith wrote:
> Also, interesting are the results of which and whereis:
> which gcc
> /opt/local/bin/gcc
> whereis gcc
> /usr/bin/gcc

That is normal, whereis does not respect PATH.

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

Your shell has probably cached the location of the gcc binary from
earlier before you created the symlink with 'port select'. Just open a
new terminal window or execute 'hash -r' to clear the cache.

Rainer


More information about the macports-users mailing list