英文:
How to compile golang source code in windows
问题
我想编译golang的源代码(http://golang.org/dl/go1.3.src.tar.gz)。因为我想学习编译技术,甚至可能会修改go编译器的源代码。有人可以告诉我如何做吗?
注意,我只想在Windows上进行编译,而不是在Linux上。谢谢!
英文:
I want to compile the source code of golang (http://golang.org/dl/go1.3.src.tar.gz). Because I want to leran the technologies of compilation, even I will modify the sources codes of go compiler. Can anyone tell me how to do it?
Attention, I just want to compile it in windows, not in linux. Thanks!
答案1
得分: 3
在Windows上比在Linux上稍微复杂一些。
- 首先,你需要安装MinGW GCC工具链,并确保将其添加到环境变量中。
- 不详细介绍安装过程,因为链接中的官方HOWTO已经非常详细了。
- 下载Go的源代码,解压缩后,在终端中进入
path-to-go/src
目录。 - 运行
all.bat
,如果一切顺利,一段时间后你应该会看到输出ALL TESTS PASSED
。
英文:
It's a little bit more complicated on windows than on Linux
- You have to install the MinGW GCC tool chain and make sure you put it in your path.
- Not going into details because the official HOWTO on that link is very detailed.
- Download Go's source, unpack it, open a terminal and
cd path-to-go/src
. - run
all.bat
, if all goes well you should getALL TESTS PASSED
printed out after a while.
答案2
得分: 0
这对我来说很有效。我可以使用这种方法在Windows 7和8.1上同时运行32位和64位的Go。
你可能也想尝试一下这个。
英文:
This works well for me. I can get both 32 bit and 64 bit go working on windows 7 and 8.1 using this method:
You might like to also give this a go.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论