如何交叉编译从Windows到Linux? [英] How to cross compile from Windows to Linux?
问题描述
我在Windows机器上安装了Go 1.2,编写了一个虚拟程序并设置了环境变量 当我发出 这是什么意思? 如果你的windows GOARCH是amd64,那么你可以通过运行构建所需的所有工具这个小批量程序: 如果成功,那么您应该能够做到你所描述的(只使用amd64,而不是AMD64--它是区分大小写的)。 如果你的windows GOARCH是386,那么你需要先建立你的386工具。你需要为此下载mingw gcc。做什么user2714852说。 这里 https://golang.org/wiki/WindowsCrossCompiling 是类似的Linux指令,也许你会发现它们很有用。 Alex I've installed Go 1.2 on a Windows machine, wrote up a dummy program and set the environment variables When i issue the " What does this mean? It tells you it needs all tools built before you can use them. If your windows GOARCH is amd64, then you could "build" all required tools by running this small batch programs: If that succeeds then you should be able to do what you've described (just use amd64, not AMD64 - it is case sensitive). If your windows GOARCH is 386, then you would need to build your 386 tools first. You would need to download mingw gcc for that. Do what user2714852 said. Here https://golang.org/wiki/WindowsCrossCompiling are similar instructions for linux, perhaps you find them helpful. Alex 这篇关于如何交叉编译从Windows到Linux?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! GOARCH
和 GOOS $ c
go build
命令时,我收到一个错误:
go build runtime:linux / amd64必须使用make.bat
引导。 code>
set GOARCH = amd64
set GOOS = linux
go tool dist install - v pkg / runtime
go install -v -a std
GOARCH
and GOOS
to "AMD64" and "linux" respectively.go build
" command, i receive an error:go build runtime: linux/amd64 must be bootstrapped using make.bat
set GOARCH=amd64
set GOOS=linux
go tool dist install -v pkg/runtime
go install -v -a std