goLang 依赖项的问题
Issues with goLang dependencies
我正在尝试编译以下 github project,但是我遇到了依赖项问题。以下 go get 命令失败并出现以下错误
go get -u github.com/go-gl/glfw/v3.1/glfw
因以下原因失败:
# 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.
和
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)
我在 /usr/local/go
中安装了 golang,在 ~/.profile 中安装了以下内容:
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin
对于您的第一个问题,这是因为您的 ubuntu 机器中缺少 GL.h。您可以按照 go-gl github page:
中的要求安装开发库来安装它
sudo apt-get install libgl1-mesa-dev
之后,你就可以去获取核心库了。我已经在我的亚马逊 ubuntu 实例上进行了测试并且运行良好。
如果仍然缺少某些内容,请尝试 google 使用关键字:
ubuntu the_missing_file_name is missing
此外,我发现此页面对您的安装问题非常有用:https://github.com/google/gxui/wiki/Installation
基本上,安装这些软件包:
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
安装完所有需要的开发包后,就可以成功获取glfw了:)
我正在尝试编译以下 github project,但是我遇到了依赖项问题。以下 go get 命令失败并出现以下错误
go get -u github.com/go-gl/glfw/v3.1/glfw
因以下原因失败:
# 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.
和
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)
我在 /usr/local/go
中安装了 golang,在 ~/.profile 中安装了以下内容:
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin
对于您的第一个问题,这是因为您的 ubuntu 机器中缺少 GL.h。您可以按照 go-gl github page:
中的要求安装开发库来安装它sudo apt-get install libgl1-mesa-dev
之后,你就可以去获取核心库了。我已经在我的亚马逊 ubuntu 实例上进行了测试并且运行良好。
如果仍然缺少某些内容,请尝试 google 使用关键字:
ubuntu the_missing_file_name is missing
此外,我发现此页面对您的安装问题非常有用:https://github.com/google/gxui/wiki/Installation
基本上,安装这些软件包:
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
安装完所有需要的开发包后,就可以成功获取glfw了:)