问题
I'm looking to give the 'Go' programming language a try but I'm having trouble getting even a simple test example to work. I think it's probably an issue with the port so I've submitted a ticket under issues in gomingw project page.
What steps will reproduce the problem?
- Create any simple go test program
- compile it with 8g. ie. 8g hello.go
- link it with 8l. ie. 8l hello.8
What is the expected output? What do you see instead?
I expect 8l to link successfully with no errors. Instead I see the follow errors output followed with a crash.
> goos is not known: mingw
> warning: uanble to find runtime.a
> runtime.morestack not defined
What version of the product are you using? On what operating system?
This is on windows 7 with gowin32_2010-12-02.zip
Please provide any additional information below.
I have set the 4 standard go variables on my environment as follows: goos = mingw, gobin = G:\oss\go\bin, goarch = 386, goroot = G:\oss\go
From looking at the error, I'm going to say it looks like it needs something from mingw gcc toolset? Though I see no mention of this requirement anywhere, neither in the readme or install. What is the runtime.a that is missing? Is it part of mingw? I've also tried one version before this latest one and the problem is present on that version as well.
Has anyone else that's tried Go's port of windows encountered an issue like this? What could be causing this?
Thanks
回答1:
The reason for the failure is stated in the error message: goos is not known: mingw
. Read the instructions for setting the GOOS environment variable. Set GOOS=windows.
You should also be using the latest release of the Go Windows port binary.
来源:https://stackoverflow.com/questions/4383377/go-windows-port-build-problems-8l-linker-crashes