Mac安装Command Line Tools
2017-06-03 本文已影响5438人
天天想念
从App Store上下载的Xcode,默认是不会安装Command Line Tools的,Command Line Tools是在Xcode中的一款工具,可以在命令行中运行C程序。
在终端中输入命令
xcode-select --install
会弹出提示框

选择同意协议

安装中

安装完成后,在终端中执行gcc -v命令查看是否安装成功。
如果显示如下内容,则按照成功。
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