今天从Github拉取了一份代码,结果一编译就出现了以下错误:
| |
解决方法:
- 下载符合自己系统版本的压缩包,https://sourceforge.net/projects/mingw-w64/files/mingw-w64/
** 操作系统:windows10 64位 , 下载这个版本 **
压缩包解压之后得到一个
mingw64文件夹,直接将整个文件夹复制放入以下路径C:\Program Files (x86)\将路径
C:\Program Files (x86)\mingw64\bin加入系统和用户环境变量Path
重新打开CMD窗口,输入
gcc -v,如果能正确看到版本号,说明安装成功。
参考文章:https://blog.51cto.com/u_15274085/2918704
![Featured image of post [Golang] cgo: C compiler "gcc" not found](/p/656/banner_hu_b58608658985da8b.jpg)