天天看點

Mac安裝Command Line Tools

從App Store上下載下傳的Xcode,預設是不會安裝Command Line Tools的,Command Line Tools是在Xcode中的一款工具,可以在指令行中運作C程式。

在終端中輸入指令

xcode-select --install      

會彈出提示框

Mac安裝Command Line Tools

選擇同意協定 

Mac安裝Command Line Tools

安裝中

Mac安裝Command Line Tools

安裝完成後,在終端中執行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      

參考位址

轉載于:https://www.cnblogs.com/jerryspace/p/10316106.html