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 freertos下使用外部中断失效
  • ¥15 输入的char字符转为int类型,不是对应的ascall码,如何才能使之转换为对应ascall码?或者使输入的char字符可以正常与其他字符比较?
  • ¥15 devserver配置完 启动服务 无法访问static上的资源
  • ¥15 解决websocket跟c#客户端通信
  • ¥30 Python调用dll文件输出Nan重置dll状态
  • ¥15 浮动div的高度控制问题。
  • ¥66 换电脑后应用程序报错
  • ¥50 array数据同步问题
  • ¥15 pic16F877a单片机的外部触发中断程序仿真失效
  • ¥15 Matlab插值拟合差分微分规划图论