Go编译器可以在Windows上安装吗?

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

Can Go compiler be installed on Windows?

问题

我一直在golang.org上寻找Windows编译器,但似乎找不到。我只能看到Linux和OS X的编译器。有人知道Go编程是否可以在Windows上进行,还是Google尚未实现这个功能?

更新:截至目前(2012年11月),golang.org已经发布了Windows 32/x86_64的官方二进制版本。

英文:

I've been looking on golang.org for a Windows compiler, but I can't seem to find it. I can only see Linux and OS X compilers. Does anyone know if Go programming can be done on Windows, or is it something that Google hasn't implemented yet?

Update: appears that as of now (Nov. 2012) golang.org has official binary releases for windows 32/x86_64.

答案1

得分: 54

现在有适用于Windows的安装程序,请参见在Windows下使用Go

HelloWorld.go

package main

func main() {
	println("Hello World!");
}

使用8g编译,使用8l链接,然后执行。示例:

8g HelloWorld.go
8l -o HelloWorld.exe HelloWorld.8
HelloWorld
英文:

There are now installers for Windows, see Go under Windows

HelloWorld.go

package main

func main() {
	println("Hello World!");
}

Compile with 8g, link with 8l and then execute. Example:

8g HelloWorld.go
8l -o HelloWorld.exe HelloWorld.8
HelloWorld

答案2

得分: 23

它尚未出现在Go Lang FAQ中,但从变更日志中可以看出:

> 为什么Go不能在Windows上运行?
我们知道世界上有很大一部分计算机运行Windows,如果这些计算机能够运行Go程序将是很好的。然而,Go团队规模较小,目前没有资源来进行Windows移植。我们非常愿意回答问题并向任何愿意开发Windows版本的人提供建议。

英文:

It hasn't made it onto the Go Lang FAQ yet, but from the changelog:

> Why doesn't Go run on Windows?
We understand that a significant fraction of computers in the world
run Windows and it would be great if those computers could run Go
programs. However, the Go team is small and we don't have the
resources to do a Windows port at the moment. We would be
more than willing to answer questions and offer advice to anyone
willing to develop a Windows version.

答案3

得分: 12

是的!截至2012年,Go的官方主页提供了一个官方的Windows安装程序(32位或64位)https://golang.org/dl/

英文:

Yes! As of 2012 the Go homepage offers an official Windows installer (32 or 64 bit) https://golang.org/dl/

答案4

得分: 7

尽管Go语言只有两天的历史,但这个问题已经成为Go邮件列表上的常见问题(不幸的是,它还没有被添加到网站的常见问题列表中)。

基本上,Go语言是由一小群人开发的,所以他们没有时间和资源来进行Windows版本的移植。这个小群人也恰好是Unix的发明者,所以这是一个自然的首要目标。

英文:

Despite the fact that Go is only two days old, this question has already become a FAQ on the Go mailinglist. (Unfortunately, it has not yet been added to the FAQ list on the website.)

Basically, Go is done by a very small group of people, so they simply do not have the time nor the resources to do a Windows port. That very small group of people also happens to be the people who invented Unix, so that was kind of a natural first target.

答案5

得分: 3

还没有。

Go语言的作者在非Windows操作系统上有非常深厚的根基(有趣的是,他们中的某人创造了UNIX操作系统)。

所以,不要指望他们很快会有一个Windows版本。

这门语言是开源的,所以只是时间问题(大约6-8个月)就会有一个Windows实现可用。

英文:

Not yet.

The authors of Go have very very deeply roots on non Windows operating systems ( Trivia: who of them created no less than the very UNIX operating system )

So, don't expect to have a Windows port from them any time soon.

The language is open source, so it will be just a matter of time ( make it from 6 - 8 ehrm months ) for a Windows implementation will be available.

答案6

得分: 3

所以,如果你和我一样,经常使用Windows,并且想要立即进行一些Go编程,你可以在虚拟机上进行。我使用VirtualBox在无缝模式下运行Ubuntu。我已经设置好了,因为我更喜欢Linux而不是Windows的很多东西。

对我来说,构建和使用Go完全没有痛苦。我在终端中打开一个Bash来运行我的构建并尝试我的应用程序。源代码目录是Windows和Linux之间的共享文件夹(这是VirtualBox的一个功能,但我相信VMWare也有同样的功能)。我在Windows上使用Komodo Edit编辑我的代码,并在两个操作系统上使用Mercurial来管理相同的源代码。

英文:

So if you, like me, are on Windows a lot of the time and want to do some Go programming right now, you can do it on a VM. I use VirtualBox running Ubuntu in seemless mode. I already had it set up because I like Linux better than Windows for a lot of things.

Building and working with Go has been totally painless for me. I have a Bash open in a terminal to run my build and try my app. The source directory is a shared folder between Windows and Linux (a VirtualBox feature but I'm sure VMWare has the same thing). I edit my code in Komodo Edit on Windows and use Mercurial for the same source code on both OSes.

答案7

得分: 0

尽管目前还没有Windows版本,但可以假设可以在Windows平台上使用Cygwin进行编译。

英文:

Although there is no Windows version at the moment, it can presumably be compiled using Cygwin on a Windows platform.

答案8

得分: 0

各种努力正在进行中,将Go移植到Windows平台。

最先进的移植版本已经可以构建和运行一些代码,可以在这里找到:http://code.google.com/r/hectorchu-go-windows/

英文:

Various efforts to port Go to windows are underway.

The most advance and that can already build and run some code is here: http://code.google.com/r/hectorchu-go-windows/

答案9

得分: -2

在Windows上安装Go非常简单,如果您使用实验性的x32 Windows端口。有关在Windows上安装Go的步骤的文档可以在这里找到。

您可能还需要MinGW工具(bash,make,gcc等):
http://sourceforge.net/projects/mingw/files/

以及GTK+文件和工具(“all-in-one bundle”包括pkg-config):
http://www.gtk.org/download/win32.php

英文:

Installation of Go on windows is straight forward if you use the experimental x32 windows port . Documentation of the steps for Go installation on windows can found here

You will probably also want the MinGW tools (bash, make, gcc, etc...):
http://sourceforge.net/projects/mingw/files/

and the GTK+ files and tools (the "all-in-one bundle" includes pkg-config):
http://www.gtk.org/download/win32.php

huangapple
  • 本文由 发表于 2009年11月12日 03:55:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/1717652.html
匿名

发表评论

匿名网友

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

确定