runnerw.exe: CreateProcess failed with error 216 with a simple Hello World

The full error message:

runnerw.exe: CreateProcess failed with 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 publisher.


I've already searched and looked into this thread but it has no use to me since I am using the package main. GOPATH and GODIR are properly set.


The code:

package main

import "fmt"

func main() {
fmt.Printf("Hello, world.\n")




What go version you use? Can you run `go version` in the terminal?


Hello, here it is:
C:\Users\Federico>go version
go version go1.10.3 windows/amd64


The GoLand version is 181.5281.38 from this 15 June.


Please attach entire output of GoLand. Also could you please attach or send me to zolotov at logs? You can collect them with `Help | Compress and show in <file browser>` action.


I've solved the issue apparently, the problem was an improper workspace directory hierarchy as I had my main.go into /src/main.go.

When I moved it to /src/test/main/main.go it compiled successfully. However the generated .exe is placed next to it instead of /bin 🤔


By default generated *.exe is placed in temp directory and removed right after execution finished. Output directory can be configured via `Run | Edit configurations... | <your run configuration> | Output directory`.


Oh ok! I thought that GoLand honored the GOPATH convention mentied here by default 


GoLand honors GOPATH convention but the convention has nothing to do with creating binaries while compiling. E.g. `go build` put binaries in the working directory.

As I said by default binary is not stored at all, putting it in GOPATH/bin will give you nothing but polluting your PATH. Still, you have a mechanism to store binary anywhere you want.


The problem was in `-i` parameter. For some reason go build generated corrupted binary if run with `-i`.

To avoid using the parameter in GoLand, it can be removed in all already created run configurations and in default ones: `Run | Edit configurations… | Defaults | Go Build | Go tool arguments` and `Run | Edit configurations… | Defaults | Go Test | Go tool arguments`.


Had the same problem and Federico's solution worked for me as well, thanks :)


@Marius can you please explain what steps have you applied to fix the problem? As Alexander wrote above, the IDE honors the Go Workspace, so we should understand what happens in order to prevent it from happening to other users. Thank you.


This will also happen if you leave the package name something other than main yet the GO plugin at least will set the package name to the file name. I'm also new to GO config so maybe this is something common knowledge. Though is there anyway possible to turn off the prevention of me typing imports. Though it might be put there to avoid me form importing something it cant find and if I call it in the code it auto imports. I think that is extremely frustrating to someone new.


YES, Are you new to GO , try to rename package name to main and try.

package main

Changing the package name to main, only in the code level, fixed this error for me.



Not sure why it wasn't mentioned if you use go build it will put the binary in the same folder, but go install will place it in the bin folder.


> Not sure why it wasn't mentioned if you use go build it will put the binary in the same folder, but go install will place it in the bin folder.


This is covered in the Go documentation, and here as well as typing ` go help build ` and related commands.


Please sign in to leave a comment.