Xcode 4.3 Command Line Tools

After installing new Xcode 4.3, I found that common tools including gcc and g++ are lost.  That is because Xcode does not install these tools into standard locations (/usr/bin nor /usr/local/bin).  But the fix is simple:

  1. Install “Command Line Tools” in Xcode : Preferences > Downloads > Command Line Tools > Install
  2. Download and install command line tools from https://developer.apple.com/. You need to login but it is free.  And you do not need to install Xcode.

Another looks-good solution is

export PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH

But it does not work completely. For example, you might suffer from the difficulties including cannot find system header files.