从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

参考地址

 

相关文章:

  • 2021-07-23
  • 2021-11-12
  • 2021-12-03
  • 2021-07-21
  • 2021-07-01
  • 2022-12-23
  • 2021-10-09
猜你喜欢
  • 2022-12-23
  • 2021-09-25
  • 2022-02-07
  • 2021-09-19
  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
相关资源
相似解决方案