I git clone code from github.com/google/gxui and then
cd samples/hello_word
GOOS=windows go build
an error occurred it says
/d01/gopath/src/github.com/goxjs/gl/gl_opengl.go:10:2: no buildable Go source files in /d01/gopath/src/github.com/go-gl/gl/v2.1/gl /d01/gopath/src/github.com/goxjs/glfw/desktop.go:10:2: no buildable Go source files in /d01/gopath/src/github.com/go-gl/glfw/v3.2/glfw
I try to
go get -u github.com/go-gl/gl/v2.1/gl go get -u github.com/go-gl/glfw/v3.2/glfw
no error occurred
I try to run again
GOOS=windows go build
The problem has not been solved
This could be happening because of your mac doesn't have a c compiler that can cross compiler to the target OS. I tried it on a Linux OS and it compiles without any issues. there was an issue on git about it last year and it's still open till today. I would suggest compiling it directly on the target OS. If you look throught the code in
github.com/go-gl/gl/v2.1/gl/conversions.go
you will notice that it import "c" meaing it will require a C compiler that is compartible with the target OS.