Shared publicly  - 
 
Having gcc problems with Xcode 4.2 or Xcode 4.3?

I had a little fun during the weekend. Some terminal commands use /usr/bin/gcc which is symlinked to /usr/bin/llvm-gcc-4.2 (this still happens even if you override CC to use /usr/bin/gcc-4.2). Some commands though, like RVM prefer, to use gcc-4.2 but I prefer the LLVM-based gcc for Xcode 4.3. So my solution wass to override gcc only in the terminal:

1. I created the ff symlinks in ~/.bin (I prefer .bin since it doesn't show up in Finder):
ln -s /usr/bin/gcc-4.2 cc
ln -s /usr/bin/gcc-4.2 gcc
ln -s /usr/bin/c++-4.2 c++
ln -s /usr/bin/g++-4.2 g++

2. I preprended ~/.bin to PATH in .bash_profile:

export PATH=~/.bin:$PATH

3. Reloaded .bash_profile:

source .bash_profile

Smooth sailing from there.
1
Add a comment...