doufu6423 2014-02-07 21:54
浏览 63
已采纳

golang opengl Windows安装问题

I'm trying to install ("go get...") opengl (https://github.com/go-gl/gl) on a Windows7 machine . I have 32 bit Go installed. 32 bit glew .lib .dll and .h files downloaded. I modified the path environment variable to point to these glew files. I have cygwin along with mingw installed. I also have git and mercurial installed for the use of go get command. I also have my GOPATH and GOROOT set as appropriate.

PS C:\Users\peterpan> go get github.com/go-gl/gl
# github.com/go-gl/gl
In file included from C:\cygwin\home\peterpan\GoProjects\src\github.com\go-gl\gl\attriblocation.go:7:0:
gl.h:2:21: fatal error: GL/glew.h: No such file or directory
#include <GL/glew.h>
                 ^
compilation terminated.

Now does anyone know where the glew dll and .h files are supposed to go on windows to make compilation work with go get?

  • 写回答

1条回答 默认 最新

  • doupin5667 2014-02-07 22:09
    关注

    In the location of your MinGW install, there are likely folders called include, lib, and bin. You'll want glew.h in include\GL\glew.h. If they're not under MinGW they're likely somewhere under your Cygwin install.

    However, there's a trick here. Since you say you have a .lib file, I'm going to assume you downloaded the precompiled Windows binaries. You can't do this, those are for Visual C and use with Visual Studio. You're, unfortunately, going to have to build it from source. It's a bit finicky, but there should be resources to help you build to a MinGW target.

    After you finish building it, you should get the files glew32.dll and libglew32.dll.a. These correspond to the .dll and the .lib you mentioned, respectively. You'll want glew32.dll in either bin or C:\Windows\System32 (though technically anywhere in your Path should work, those are the more "standard" locations). You'll want the .a file in the lib directory.

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

报告相同问题?

悬赏问题

  • ¥50 易语言把MYSQL数据库中的数据添加至组合框
  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况