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

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

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探