我正在跟踪go文档并尝试运行hello.go。我在Windows 7上,使用msi安装程序安装go 1.1.2。我有文件"C:\Go\pkg\tool\windows_386\8g.exe“(参见下面的dir输出),但是当我执行'go.exe Runhello.go‘时,我得到的文件不存在错误。
请帮帮忙。谢谢。
C:\>go.exe run hello.go
go build command-line-arguments: exec: "C:\\Go\\pkg\\tool\\windows_386\\8g.exe":
file does not exist
C:\>go.exe version
go version go1.1.2 windows/386
C:\>go.exe run hello.go
go build command-line-arguments: exec: "C:\\Go\\pkg\\tool\\windows_386\\8g.exe":
file does not exist
C:\>dir C:\\Go\\pkg\\tool\\windows_386\\8g.exe
The specified path is invalid.
C:\>dir C:\Go\pkg\tool\\windows_386\\8g.exe
Volume in drive C is Local Disk
Volume Serial Number is C07E-54F5
Directory of C:\Go\pkg\tool\windows_386
08/13/2013 07:04 AM 1,831,416 8g.exe
1 File(s) 1,831,416 bytes
0 Dir(s) 11,407,892,480 bytes free发布于 2013-08-24 14:02:35
在运行第6224期之前,如果环境变量PATHEXT只设置为一个扩展,则会发生此错误。
set PATHEXT=.BATgo run hello.go预期的产出是多少? 没有错误,并且hello world程序运行 你看到的是什么?
go build command-line-arguments:
exec: "c:\\Go\\pkg\\tool\\windows_386\\8g.exe": file does not exist8g Windows 7 64位go版本go1.1.2 windows/386
在我的计算机(W7 64位)上,我有:
set pa
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC一切都很顺利。
LookPath是用"c:\Go\pkg\tool\windows_386\8g.exe“来调用的,而PATHEXT是以一种邪恶的方式设置的--比如说,让LookPath失败
https://stackoverflow.com/questions/18388156
复制相似问题