目录

mac安装gcc报错

目录

mac安装gcc报错问题处理

  • State “DONE” from “STARTED” [2020-07-26 周日 08:48] 报错已处理
  • State “STARTED” from “TODO” [2020-07-26 周日 08:47]

安装gcc报错如下

zhangpeipeideMacBook-Air:~ qikun$ brew install gcc
Warning: Your Xcode (11.1) is outdated.
Please update to Xcode 11.4.1 (or delete it).
Xcode can be updated from the App Store.

Warning: Building gcc from source:
  The bottle needs the Xcode CLT to be installed.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: An exception occurred within a child process:
  CompilerSelectionError: gcc cannot be built with any available compilers.
Install GNU's GCC:
  brew install gcc

通过appstore安装xcode后继续安装gcc报错如下

zhangpeipeideMacBook-Air:~ qikun$ brew install gcc
Warning: Building gcc from source:
  The bottle needs the Xcode CLT to be installed.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: An exception occurred within a child process:
  CompilerSelectionError: gcc cannot be built with any available compilers.
Install GNU's GCC:
  brew install gcc

原因是 在从App Store上下载Xcode后,默认是不会安装Command Line Tools的. 先更新一下xcode,继续安装gcc

zhangpeipeideMacBook-Air:~ qikun$ xcode-select --install
xcode-select: note: install requested for command line developer tools