從App Store上下載的Xcode,默認(rèn)是不會(huì)安裝Command Line Tools的皿伺,Command Line Tools是在Xcode中的一款工具员辩,可以在命令行中運(yùn)行C程序。
在終端中輸入命令
xcode-select --install
會(huì)彈出提示框
選擇同意協(xié)議
安裝中
安裝完成后鸵鸥,在終端中執(zhí)行gcc -v命令查看是否安裝成功奠滑。
如果顯示如下內(nèi)容,則按照成功妒穴。
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin