Windows version not compatible with Goland. Programs will not run

Answered

I keep getting this error message below whenever I try to run a program and cannot seem to figure out the issue.

Cannot run program "C:\Users\(username)\AppData\Local\JetBrains\GoLand2023.3\tmp\GoLand\___go_build_awesomeProject.exe" (in directory "C:\Users\(username)\GolandProjects\awesomeProject"): CreateProcess error=216, This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publishe

0
5 comments

Hi there,
 
Thank you for your message and sorry to hear about the troubles you're having while running the code. To check this further, here's what I'd like to clarify:
 

  1. Could you please share some code snippets using which it is possible to reproduce the problem so we could test this on our end? 
  2. I also wanted to check if this happens with all projects or just this specific one on your end?
  3. Please let me know if this used to work before, and if so - when did you notice the issue first?
  4. Finally, could you please generate and send us the GoLand logs? You can upload the files here - https://uploads.jetbrains.com/ after generating them via Help | Collect Logs and Diagnostic Data in your IDE.

 
Thank you and I hope to hear from you soon!

1

1. I am running the basic “Hello World” code

 package awesomeProject
import “fmt”
func main() {
    fmt.Println("Hello World")
}

2. Happens on all my projects. I don't think I did my go build wrong but could that be the issue

3. I am new to Go and Goland so I have not used it before this

4. 2024_01_29_BvDn6DAHry24kuLQiLis2y    Here is the upload id for the files

0

Hi there!
 
Thank you so much for the details provided, those helped a lot. I believe the root cause of the issue here would be with the code you're running (specifically, the package name - awesomeProject).
 
Could you please check if changing the package name to "main" makes any difference? Please try this code:
 

package main

import "fmt"

func main() {
    fmt.Println("Hello World")
}

 
In Go language, the main executable function would run inside of the "package main" only, hence, this is the most probable cause of the issue. 
 
Thank you and please let me know how it goes.
 

1

Changing the package to main did work thank you! Do the name of functions have to be the same as packages in Go?

0

This rule applies to the executable package only (executable package main should contain special function main() which will execute the application). Other packages used in the project can have arbitrary names with arbitrary functions - those will not be directly executed, but would be used after import inside of func main(). I hope my explanation makes some sense.

1

Please sign in to leave a comment.