问题描述
使用sublime text3编译go语言时,出现以下问题:
exec: "gcc": executable file not found in %PATH%
exit status 2
解决方案
下载mingw64
下载地址[:https://sourceforge.net/projects/mingw-w64/](https://sourceforge.net/projects/mingw-w64/)<br /><br />点击"Download"按钮:<br />
安装
下载mingw-w64-install.exe执行安装(离线按钮,比较慢):
根据系统环境,选择相关配置:
选择安装路径
下载比较慢,耐心等待…
环境测试
在cmd下,打开安装路径下的&{installdir}\mingw-w64\i686-6.2.0-posix-dwarf-rt_v5-rev1\mingw32\bin目录下,输入gcc -v, 出现如下图,说明安装成功
通过压缩包安装
下载压缩包,解压到指定的目录下,如下图:<br />
在cmd下,打开安装路径下的&{installdir}\mingw-w64\i686-6.2.0-posix-dwarf-rt_v5-rev1\mingw32\bin目录下,输入gcc -v, 出现如下图:
应用测试
安装成功后,如何让go编译器调用gcc呢?需要设置系统环境变量path,如下添加C:\mingw64\bin到path环境变量值下:
再次编译go语言,问题解决~~.