Go汇编:
0 known bugs; 0 unexpected bugs
并输入“helloword”:
package main
import "fmt"
func main() {
fmt.Printf("Hello, 世界\n")
}
然后我试着编译它,但它不会去:
$ 8c gotest2
gotest2:1 not a function
gotest2:1 syntax error, last name: main
这是在奔腾的UbuntuLinux上进行的。安装并通过测试。我哪里出错了?有人能告诉我从这里往哪里走吗?
我也试过这个程序:
package main
import fmt "fmt" // Package implementing formatted I/O.
func main() {
fmt.Printf("Hello, world; or Καλημέρα κόσμε; or こんにちは 世界\n");
}
但这也是不能去的(必须停止使用双关语):
$ 8c gotest3.go
gotest3.go:1 not a function
gotest3.go:1 syntax error, last name: main
发布于 2018-04-12 08:26:21
您使用的是8c,它是c编译器。8g将编译go,8l将链接。
发布于 2018-04-12 09:11:09
对于Go 1.0+,正确的构建命令现在是:go build
https://stackoverflow.com/questions/-100008072
复制相似问题