.go文件编译错误,适用于Windows 64位系统。

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

.go file compilation error for windows 64bit

问题

我的原始问题是这个。peterSO正确回答了这个问题。然而,当我尝试执行.go程序时,我发现了像这个这样的错误,对于程序1这个对于程序2。有人可以帮我解决这个问题吗?

英文:

My original question was, this. Which was answered by peterSO correctly. However, when I am trying to execute .go program, I found errors like this for program 1 and thisfor program 2. Can anybody help me about, how can this be solved ?

答案1

得分: 3

你已经安装了多个版本的Go,包括release/release.r60.3weekly.2011-09-01适用于windows 386。如果你的PATH环境变量指向8g适用于[windows 386 release.r60.3 10076],但是你的GOROOT环境变量指向[windows 386 weekly.2011-09-01 9631]的包,你将会得到以下错误。

C:\Arpssss> 8g hello.go
hello.go:3: import C:/go/pkg/windows_386/fmt.a: 
object is [windows 386 weekly.2011-09-01 9631] 
expected [windows 386 release.r60.3 10076]

清理你所创建的混乱!卸载Go。删除所有Go安装文件夹。安装gowin386_release.r60.3_installer.exe

检查你的GOROOT(用于Go包)和GOBIN(用于8g)环境变量。

C:\>set GO
GOBIN=C:/Go/bin
GOROOT=C:/Go

检查GOBIN是你PATH环境变量中唯一的go文件夹。例如,

C:\>set PATH
PATH=...;C:/Go/bin;...;

其中...是省略号。

英文:

You have been installing multiple versions of Go, including release/release.r60.3 and weekly.2011-09-01 for windows 386. If your PATH environment variable points to 8g for [windows 386 release.r60.3 10076] but your GOROOT environment variable points to packages for [windows 386 weekly.2011-09-01 9631], you will get the following error.

C:\Arpssss> 8g hello.go
hello.go:3: import C:/go/pkg/windows_386/fmt.a: 
object is [windows 386 weekly.2011-09-01 9631] 
expected [windows 386 release.r60.3 10076]

Clean up the mess you've created! Uninstall Go. Delete all go installation folders. Install gowin386_release.r60.3_installer.exe.

Check your GOROOT (for Go packages) and GOBIN (for 8g) environment variables.

C:\>set GO
GOBIN=C:/Go/bin
GOROOT=C:/Go

Check that GOBIN is the only go folder in your PATH environment variable. For example,

C:\>set PATH
PATH=...;C:/Go/bin;...;

where ... is an ellipsis.

huangapple
  • 本文由 发表于 2011年11月29日 01:07:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/8299510.html
匿名

发表评论

匿名网友

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

确定