(转)VSCode调试go语言出现:exec: "gcc": executable file not found in %PATH%
原文:https://www.cnblogs.com/zsy/p/5958170.html
1、问题描述
由于安装VS15 Preview 5,搞的系统由重新安装一次;在用vscdoe编译go语言时,出现以下问题:
# odbc
exec: "gcc": executable file not found in %PATH%
exit status 2

2、解决方案
2.1 mingw 64
MinGW分为较早开发的MinGW32和之后为编译64位程序开发的MinGW-w64,MinGW32只能编译32位的程序,而mingw64不仅能编译64位程序,也能编译32位程序,还能进行交叉编译,即在32位主机上编译64位程序,在64位主机上编译32位程序。
由于用的window10 企业版64位操作系统,要下载mingw 64位(官网地址:http://mingw-w64.org/doku.php),下载地址:https://sourceforge.net/projects/mingw-w64/

点击“Download”按钮,

2.2 安装须知
在使用mingw64之前,由于其支持较多的编译类型,所以其安装包较多,需要了解其安装包的命名规则:http://sourceforge.net/apps/trac/mingw-w64/wiki/download%20filename%20structure
一般采用personal文件夹下的两个版本的包编译64位程序:https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/

threads-win32是编译目标程序是32位,threads-posix是编译目标程序是64位
2.3 安装过程
下载mingw-w64-install.exe之后进行安装(离线安装,比较慢,可以):

根据系统环境,选择相关配置:

选择安装路径:


下载比较慢,耐心等待……



这个安装过程是在折磨人,可以下载对应的压缩包。
2.3 环境测试
在cmd下,打开C:\mingw-w64\i686-6.2.0-posix-dwarf-rt_v5-rev1\mingw32\bin目录,输入gcc -v,出现如下图,说明安装成功:

2.4 卸载
转到C:\mingw-w64\i686-6.2.0-posix-dwarf-rt_v5-rev1目录,双击uninstall.exe打开卸载程序,如下图:



2.5 通过压缩包安装
下载压缩包,解压到C:\mingw64目录下,如下图:

在cmd窗口下,转到C:\mingw64\bin,输入gcc -v,显示如下:

OK,到此,两种方法都成功。
3、应用测试
安装成功后,如何让go编译器调用gcc呢?需要设置环境变量path,如下添加C:\mingw64\bin到path环境变量值下:

最后需要重启电脑
再次编译go语言,问题已解决~~~~
(转)VSCode调试go语言出现:exec: "gcc": executable file not found in %PATH%的更多相关文章
- CentOS VSCode调试go语言出现:exec: "gcc": executable file not found in PATH
CentOS VSCode调试go语言出现:exec: "gcc": executable file not found in PATH 解决方案: 执行如下命令安装GCC,然后重 ...
- VSCode调试go语言出现:exec: "gcc": executable file not found in %PATH%
1.问题描述 由于安装VS15 Preview 5,搞的系统由重新安装一次:在用vscdoe编译go语言时,出现以下问题: # odbcexec: "gcc": executabl ...
- go exec: "gcc": executable file not found in %PATH%
win下使用go,在进行go run build.go时,提示 exec: "gcc": executable file not found in %PATH% 原因是sqlitl ...
- Go丨语言package github.com/Go-SQL-Driver/MySQL: exec: "git": executable file not found in %PATH%解决方法
Go语言在添加第三方MySQL驱动的时候报错: go: missing Git command. See https://golang.org/s/gogetcmd package github.co ...
- gogs仓库管理软件 exec: "git-upload-pack": executable file not found in $PATH
当配置完个人中心的ssh公钥的时候,在客户端拉取代码的时候,提示如下错误: Cloning into 'comix-b2m'... Gogs: Internal error fatal: Could ...
- exec: "docker-proxy": executable file not found in $PATH
在执行 docker run 操作的时候,一直报如下错误: [root@etcd1 vagrant]# docker run --name redis-6379 -p 6379:6379 -d --r ...
- 【解决】OCI runtime exec failed......executable file not found in $PATH": unknown
[问题]使用docker exec + sh进入容器时报错 [root@localhost home]# docker exec -it container-test bash OCI runtime ...
- docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"ping\": executable file not found in $PATH": unknown.
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting cont ...
- OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "ip": executable file not found in $PATH: unknown (Docker容器没有ip addr命令:exec ip addr 报错)
一.报错 1.报错信息1: OCI runtime exec failed: exec failed: container_linux.go:380: starting container proce ...
随机推荐
- 【C#/WPF】调节图像的HSL(色相、饱和度、明亮度)
原文:[C#/WPF]调节图像的HSL(色相.饱和度.明亮度) 先说概念: HSL是一种描述颜色的方式(其他颜色描述方式还有大家熟悉的RGB值).HSL三个字母分别表示图像的Hue色相.Saturat ...
- XF Grid使用-两行两列-跟WPF不同
<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http:/ ...
- C# 异步委托回调函数使用
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...
- Pytorch Code积累
2017 Python最新面试题及答案16道题 15个重要Python面试题 测测你适不适合做Python? torch.squeeze() Returns a tensor with all the ...
- Win8Metro(C#)数字图像处理--2.11图像锐化
原文:Win8Metro(C#)数字图像处理--2.11图像锐化 [函数名称] 图像锐化函数SharpeningProcess(WriteableBitmap src,double sharpe ...
- WPF里DataGrid分页控件
1.主要代码: using System; using System.Collections.ObjectModel; using System.Windows; using System.Windo ...
- ReportViewer,RDLC 报表开发之个性化样式
原文:ReportViewer,RDLC 报表开发之个性化样式 报表开发中,客户对样式提出了要求: 1.工具栏上显示每页条数 2.只导出Excel,不需要下拉菜单. 3.报表上显示的图表,分页时,每页 ...
- C#WeakReference弱引用
原文:C#WeakReference弱引用 弱引用:在引用对象的同时,允许垃圾回收该对象. .NET中提供了WeakReference对象来实现这个功能. 对于那些创建便宜但耗费大量内存的对象,即希望 ...
- UWP-动态磁贴
原文:UWP-动态磁贴 来自:IT追梦园 (http://www.zmy123.cn/?p=1172) UWP应用的一大特色就是动态磁贴,所以,你的应用如果还没有设置动态磁贴,那么,和我一起来为应用加 ...
- 升级d7的代码到2010以上版本注意事项(SetLength的参数就是字符长度,而不是字节长度,但Move函数要改)
delphi2010是delphi所有版本的分水岭,其中2010—xe10.2之间版本上的代码都有比较好的兼容性,基本上都能直接进行编译,不需要过多修改,但d7距d2010跨度4个版本以上,新版本除了 ...