0

我从 github.com/google/gxui git clone 代码然后

cd 样本/hello_word

GOOS=windows 去构建

它说发生了错误

/d01/gopath/src/github.com/goxjs/gl/gl_opengl.go:10:2:/d01/gopath/src/github.com/go-gl/gl/v2.1/ 中没有可构建的 Go 源文件gl /d01/gopath/src/github.com/goxjs/glfw/desktop.go:10:2:/d01/gopath/src/github.com/go-gl/glfw/v3.2 中没有可构建的 Go 源文件/glfw

我试着

去获取-u github.com/go-gl/gl/v2.1/gl 去获取-u github.com/go-gl/glfw/v3.2/glfw

没有发生错误

我尝试再次运行

GOOS=windows 去构建

问题没有解决

4

1 回答 1

0

这可能是因为您的 mac 没有可以将编译器交叉编译到目标操作系统的 ac 编译器。我在 Linux 操作系统上尝试过,它编译没有任何问题。去年git 上有一个关于它的问题,直到今天它仍然开放。我建议直接在目标操作系统上编译它。如果您仔细阅读中的代码

github.com/go-gl/gl/v2.1/gl/conversions.go

您会注意到它导入“c”意味着它需要与目标操作系统兼容的 C 编译器。

于 2017-01-19T06:50:55.887 回答