Golang OpenGL Windows 安装问题

huangapple go评论87阅读模式
英文:

golang opengl windows installation issues

问题

我正在尝试在 Windows7 机器上安装("go get...")opengl(https://github.com/go-gl/gl)。我已经安装了32位的Go。下载了32位的glew .lib .dll和.h文件。我修改了环境变量的路径,指向这些glew文件。我还安装了cygwin和mingw。我还安装了git和mercurial,以便使用go get命令。我也已经设置了适当的GOPATH和GOROOT。

现在,有人知道在Windows上将glew dll和.h文件放在哪里,以使得使用go get进行编译工作吗?

英文:

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

得分: 2

在你的MinGW安装位置,可能有名为includelibbin的文件夹。你需要在include\GL\glew.h中找到glew.h。如果它们不在MinGW下,很可能在你的Cygwin安装目录下的某个地方。

然而,这里有一个技巧。由于你说你有一个.lib文件,我会假设你下载了预编译的Windows二进制文件。你不能这样做,那些是给Visual C和Visual Studio使用的。不幸的是,你需要从源代码构建它。这有点棘手,但应该有资源可以帮助你构建到MinGW目标。

在构建完成后,你应该得到glew32.dlllibglew32.dll.a这两个文件。分别对应你提到的.dll.lib文件。你需要将glew32.dll放在bin目录或C:\Windows\System32目录中(尽管在你的Path中的任何位置都可以,这些是比较“标准”的位置)。你需要将.a文件放在lib目录中。

英文:

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.

huangapple
  • 本文由 发表于 2014年2月8日 05:54:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/21638482.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定