2014-02-07 21:54
浏览 63

golang opengl Windows安装问题

I'm trying to install ("go get...") opengl ( 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
In file included from C:\cygwin\home\peterpan\GoProjects\src\\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.

    解决 无用
    打赏 举报

相关推荐 更多相似问题