去工具:没有这样的工具“编译”

时间:2015-09-02 02:47:23

标签: go goclipse

我最近开始尝试编写一些基于Web的应用程序。起初,一切都很顺利,直到我想为不同的平台交叉编译二进制文件。我正在运行MacOS,我想为linux编译二进制文件,因此我将GOOS更改为linux并将GOARCH更改为amd64。从那时起,我总是收到错误消息

go tool: no such tool "compile"

我正在使用GoClipse,但是通过

手动运行编译
go install hello.go

我得到了同样的错误。当改回到darwin架构的编译时,我现在得到了同样的错误,所以基本上我完全无法编译目前用Go编写的任何代码。

4 个答案:

答案 0 :(得分:1)

我是通过谷歌提供的二进制包安装的。最后,我实际上通过重新安装它重新开始工作。有时我只是对简单的解决方案视而不见。

之后,我通过从Go源目录运行env GOOS=linux GOARCH=arm GOROOT_BOOTSTRAP=/usr/local/go ./make.bash --no-clean编译了必要的交叉编译器,成功地为linux机器进行了交叉编译。

感谢您的所有努力,很抱歉让您忙于这么简单的事情。

答案 1 :(得分:0)

如果你安装Go 1.5,你可能会侥幸成功,但是如果你使用任何依赖于Attempting to gather dependencies information for package 'Sendgrid.6.1.0' with respect to project 'UI\MyApplication.MVC', targeting '.NETFramework,Version=v4.5.2' Attempting to resolve dependencies for package 'Sendgrid.6.1.0' with DependencyBehavior 'Lowest' Resolving actions to install package 'Sendgrid.6.1.0' Resolved actions to install package 'Sendgrid.6.1.0' For adding package 'SendGrid.SmtpApi.1.3.1' to project 'MyApplication.MVC' that targets 'net452'. For adding package 'SendGrid.SmtpApi.1.3.1' to project 'MyApplication.MVC' that targets 'net452'. Adding package 'SendGrid.SmtpApi.1.3.1' to folder 'C:\Users\Keith\Source\Workspaces\MyApplication\MyApplication.MVC\packages' Install failed. Rolling back... 的东西,你必须安装一个交叉编译器链接器或者在虚拟机上安装Linux能够为Linux进行交叉编译。

答案 2 :(得分:0)

在我的情况下,由于GOPATH和GOROOT设置不正确,您可以查看go envHere is a discussion可能有用。

答案 3 :(得分:0)

您最有可能安装了错误的x64或x386软件包。我安装了32位64位运行。重新安装修复。祝你好运。