Reputation: 2924
I'm trying to compile the following github project, however I'm having issues with the dependencies. The following go get commands fails with the errors noted below
go get -u github.com/go-gl/glfw/v3.1/glfw
fails with the following:
# github.com/go-gl/glfw/v3.1/glfw
In file included from /home/bob/go/src/github.com/go-gl/glfw/v3.1/glfw/context.go:4:0:
glfw/include/GLFW/glfw3.h:153:21: fatal error: GL/gl.h: No such file or directory
compilation terminated.
and
go get github.com/go-gl/gl/v2.1-core/gl
package github.com/go-gl/gl/v2.1-core/gl: cannot find package "github.com/go-gl/gl/v2.1-core/gl" in any of:
/usr/local/go/src/github.com/go-gl/gl/v2.1-core/gl (from $GOROOT)
/home/bob/go/src/github.com/go-gl/gl/v2.1-core/gl (from $GOPATH)
I have golang installed in /usr/local/go
and the following in ~/.profile:
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin
Upvotes: 0
Views: 419
Reputation: 4828
For your first question, it's because GL.h is missing from your ubuntu machine. You could get it installed by installing the dev lib as stated as requirement in their go-gl github page:
sudo apt-get install libgl1-mesa-dev
After this, you could go get the core lib. I've tested on my amazon ubuntu instance and worked fine.
If there still are something missing, try google using the key word:
ubuntu the_missing_file_name is missing
Also, I find this page very useful for your installing issues: https://github.com/google/gxui/wiki/Installation
Basically, install these packages:
sudo apt-get install libgl1-mesa-dev (or freeglut3-dev)
sudo apt-get install libxrandr-dev
sudo apt-get install libxcursor-dev
sudo apt-get install libxi-dev
sudo apt-get install libxinerama-dev
After you installed all the required dev packages, you could go get glfw successfully :)
Upvotes: 2