运行Go程序时出现错误

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

Error running Go program

问题

我正在尝试运行一个Go程序,但总是出现这个错误。我尝试过在Google上搜索,但没有找到问题所在!截图

可执行文件(C:/Users!/ABDELLATIF-PC/Desktop/SimpleComputerRemote/Host/bin/server.exe)不存在。

英文:

i'm trying to run a Go program and it always gives me this error i tried googling it but nothing can't see what's the problem! ScreenShot

Executable file (C:/Users!/ABDELLATIF-PC/Desktop/SimpleComputerRemote/Host/bin/server.exe) doesn't exist

答案1

得分: 1

这是一个构建问题。检查你的 bin 文件夹,确保程序可以访问该文件夹。检查偏好设置和缺失的引用,针对 Go 项目。

英文:

Its a build issue. Check your bin folder
Whether program has access to the folder
Check preferences and missing references for the golang project.

答案2

得分: 0

安装过程应由Host/install/windows/innosetup-x64.iss驱动,使用InnoSetup
您需要检查安装程序是否正确安装了exe文件,并且为什么它会寻找C:/Users!/...而不是C:/Users/...

英文:

The setup process should be driven by Host/install/windows/innosetup-x64.iss for InnoSetup:
You need to check if the setup properly installed the exe, and why it looks for C:/Users!/... instead of C:/Users/...

答案3

得分: 0

我找到了问题,这不是配置问题或其他什么问题。你需要按照以下三个步骤进行操作:

1)确保GOPATH的值与GOROOT不同。
2)确保GOBIN的值为空。
3)在Eclipse中,你的go文件的包名应该是main,而不是"hello"。至少对于包含main函数的文件来说,应该是这样的。要做到这一点,选择文件->新建go文件->源文件类型应该是->命令源文件->空的main函数。然后在此之后输入你的代码,然后可以构建并在GOPATH/bin目录下看到.exe文件并运行程序。

对我来说有效。

英文:

I managed to find the issue, It is no configuration issue or anything. You have to do 3 things as follows,

  1. Make sure GOPATH value is different from GOROOT.
  2. Make sure GOBIN value is empty.
  3. Your package name on the go file in eclipse should be main and not the package name "hello". This should be the case for at least the file that has main function. To do this, File->New go file->Source file type should be -> Command source file-> Empty main function. Then type your code after which you can build to see the the .exe file in GOPATH/bin and the program run.

Worked for me.

huangapple
  • 本文由 发表于 2015年1月5日 07:12:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/27771402.html
匿名

发表评论

匿名网友

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

确定