1. 通过homebrew安装 这种方法比较简单,前提是mac上已经安装homebrew了,具体命令: brew tap homebrew/versions 2 .brew install gcc 安装默认版本的gcc工具