Goland中运行Golang程序出现runnerw.exe问题的解决

转自:http://www.ducksoft.site/2018-01-30/golang-runnerw/

建立了Golang的工程,写了一个Hello World程序:

1
2
3
4
5
6
7
package helloworld

import "fmt"

func main() {
	fmt.Println("Hello golang!")
}

写好之后在IDE里按下Ctrl+Shift+F10运行编译运行程序,结果竟然出现了下面的错误:

1
runnerw.exe: CreateProcess failed with error 216 (no message available)

这是因为没有给程序指定包名main造成的程序找不到入口点的问题。
修改程序,将包名改为main后,问题圆满解决。

1
2
3
4
5
6
7
package main

import "fmt"

func main() {
	fmt.Print("Hello golang!")
}

猜你喜欢

转载自blog.csdn.net/metheir/article/details/82080251
今日推荐