如何在Goclipse中使用Mingw的cgo?

huangapple go评论94阅读模式
英文:

How to use cgo in Goclipse with Mingw?

问题

当我尝试使用cgo时,我遇到了错误

exec gcc: exec: "gcc": 在%PATH%中找不到可执行文件

我已经安装了Mingw。我该如何告诉Goclipse gcc的位置?我在首选项或属性中找不到设置的方法。

英文:

When i try to use cgo I get the error

exec gcc: exec: "gcc": executable file not found in %PATH%

I have Mingw installed. How do I tell Goclipse where gcc is? I could not find a way in preferences or properties to set this.

答案1

得分: 2

将MinGW gcc的路径添加到Windows的PATH环境变量中。

在Windows下设置环境变量

英文:

Add the path to MinGW gcc to your Windows PATH environment variable.

Setting environment variables under Windows

答案2

得分: 0

我遇到了同样的问题,只想补充一点,你需要将MinGW的bin目录的路径添加到你的PATH环境变量中。类似于:

C:\Program Files\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev0\mingw64\bin

声望不够,无法以评论的形式提供,所以只能作为答案。

英文:

I had the same problem and just wanted to add that you specifically need to add the path to the bin directory of MinGW to your PATH environment variable. Something like:

C:\Program Files\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev0\mingw64\bin

Not enough reputation to make this a comment, so it's an answer.

huangapple
  • 本文由 发表于 2012年7月7日 10:21:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/11371783.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定