RussH
RussH

Reputation: 341

Can't get gcc version from to switch from 4.2.1 to 4.6 even after selecting it (MacPorts)

I'm running Snow Leopard and need to compile something using a more recent version of GCC than 4.2.1. I've been using MacPorts but can't seem to get the command-line GCC to recognize the MacPorts version:

[15:01:47] ~/Downloads$
port select gcc
Available versions for gcc:
gcc40
gcc42
llvm-gcc42
mp-gcc44
mp-gcc45
mp-gcc46 (active)
none
[15:10:04] ~/Downloads$
sudo port select gcc mp-gcc46
Selecting 'mp-gcc46' for 'gcc' succeeded. 'mp-gcc46' is now active.
[15:10:24] ~/Downloads$
sudo port select --set gcc mp-gcc46
Selecting 'mp-gcc46' for 'gcc' succeeded. 'mp-gcc46' is now active.
[15:11:34] ~/Downloads$
gcc -version
i686-apple-darwin10-gcc-4.2.1: no input files
[15:11:40] ~/Downloads$

Even though I use MacPorts select to specify a newer version, that switch does not seem to do anything (even after rebooting, etc.). I feel like I'm missing something very simple but I have looked in multiple places for some help on remedying this without luck.

Thanks!

Upvotes: 1

Views: 1617

Answers (1)

RussH
RussH

Reputation: 341

Never mind everybody. I changed my .bashrc file so that, in the PATH, the Mac ports directories come before /usr/bin instead of after.

Upvotes: 3

Related Questions