XCODE 4.3 WITH NO GCC?
Posted on 2012-04-07 21:50 RTY 閱讀(732) 評論(0) 編輯 收藏 引用 所屬分類: C/C++ 、Mac os 、轉載隨筆真的坑爹,今天才開始玩MAC OX,裝了個最新版本的10.7.3,只能裝XCODE 4.3 這個月剛發行的版本。
安裝時發現沒有install過程,直接雙擊就進入開發環境了。而且裝完后沒有gcc 等各種編譯工具,在TERMINAL下各種命令不識別,想裝ruby的各種開發工具,都不行了。
查了半天才發現:
Apple announced Xcode 4.3 for OSX Lion and 4.4 for OSX Mountain Lion last week. The major difference is that Xcode no longer provide an installer which is good thing because you now could update Xcode with AppStore in the future, plus it is much easier to carry the development environment with you. However, there is a little problem with this new version of Xcode, is that all command line toolsets and compilers are not visible in terminal.
解決方案一:
A simple fix is to update your PATH env:
export PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH
Please be noted that clang does not reside in /Developer/usr/bin, it is now in /Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Now you could access to gcc, g++, git or any toolsets bundled with Xcode. For your convenience, it is recommended to include it in your .bash_profile
.
解決方案二:
You can install these additional tools directly in Xcode :
Preferences > Downloads > Command Line Tools > Install
SO. What a fUUUcking day!