duanbai1027 2016-04-02 09:31
浏览 28
已采纳

goLang依赖项问题

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
  • 写回答

1条回答 默认 最新

  • dongre6404 2016-04-02 10:43
    关注

    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 :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?