简体   繁体   English

运行Go程序时出错

[英]Error running Go program

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! 我正在尝试运行一个Go程序,它总是给我这个错误,我试着谷歌搜索但没有什么不能看出是什么问题! ScreenShot 截图

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

Its a build issue. 这是一个构建问题。 Check your bin folder Whether program has access to the folder Check preferences and missing references for the golang project. 检查bin文件夹是否程序可以访问文件夹检查首选项和golang项目缺少的引用。

The setup process should be driven by Host/install/windows/innosetup-x64.iss for InnoSetup : 设置过程应由Host/install/windows/innosetup-x64.issInnoSetup驱动
You need to check if the setup properly installed the exe, and why it looks for C:/Users!/... instead of C:/Users/... 您需要检查设置是否正确安装了exe,以及它为什么查找C:/Users!/...而不是C:/Users/...

I managed to find the issue, It is no configuration issue or anything. 我设法找到了问题,这不是配置问题或任何事情。 You have to do 3 things as follows, 你必须做3件事,如下,

1) Make sure GOPATH value is different from GOROOT. 1)确保GOPATH值与GOROOT不同。 2) Make sure GOBIN value is empty. 2)确保GOBIN值为空。 3) Your package name on the go file in eclipse should be main and not the package name "hello". 3)eclipse中go文件中的包名应该是main而不是包名“hello”。 This should be the case for at least the file that has main function. 这应该是至少具有main函数的文件的情况。 To do this, File->New go file->Source file type should be -> Command source file-> Empty main function. 要做到这一点,File-> New go file-> Source文件类型应该是 - >命令源文件 - >空主函数。 Then type your code after which you can build to see the the .exe file in GOPATH/bin and the program run. 然后键入您的代码,之后您可以构建以查看GOPATH / bin中的.exe文件并运行程序。

Worked for me. 为我工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM