简体   繁体   English

如何在Mingc中的Goclipse中使用cgo?

[英]How to use cgo in Goclipse with Mingw?

When i try to use cgo I get the error 当我尝试使用CGO时出现错误

exec gcc: exec: "gcc": executable file not found in %PATH% exec gcc:exec:“ gcc”:在%PATH%中找不到可执行文件

I have Mingw installed. 我已经安装了Mingw。 How do I tell Goclipse where gcc is? 我如何告诉Goclipse gcc在哪里? I could not find a way in preferences or properties to set this. 我找不到在首选项或属性中进行设置的方法。

Add the path to MinGW gcc to your Windows PATH environment variable. 将MinGW gcc的路径添加到Windows PATH环境变量。

Setting environment variables under Windows 在Windows下设置环境变量

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. 我有同样的问题,只是想补充一点,您特别需要将MinGW的bin目录的路径添加到PATH环境变量中。 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. 信誉不足,无法对此发表评论,所以这是一个答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM