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.

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

报告相同问题?

悬赏问题

  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?