go-gl-legacy / gl

Go bindings for OpenGL
BSD 3-Clause "New" or "Revised" License
342 stars 52 forks source link

Issue building on Windows 7 with MinGW #160

Open nholland94 opened 10 years ago

nholland94 commented 10 years ago

I have a little game I wrote as a test for a go project called GarageEngine. I originally wrote it on OSX and decided I wanted to test the cross platform compatibility of it. I setup a Windows machine with MinGW, installed GLEW from source on the machine, and grabbed the windows binaries for GLFW 2.7 (glfw.dll, glfw.a, and glfwdll.a) and set them up. When I go to build my project, this is what I get, however:

PS C:\Go\workspace\src\github.com\nholland94\puzzle> go build
# github.com/go-gl/gl
37: error: 'glVertexAttribDivisor' undeclared (first use in this function)

I'm not sure if this is a version mismatch of my dependencies or what. Also, the only reference to glVertexAttribDivisor in the project's source code isn't even on line 37, so I don't know what that's about.

Let me know if you need any more details.

pwaller commented 10 years ago

The error is likely coming from cgo, so you're actually seeing the line number from an intermediate source file. You can use go build -x -work to see the intermediate files.

What version of GLEW have you got?

UserAB1236872 commented 10 years ago

Since he built it from source, I'd wager they have the most recent stable version of GLEW.

First step in troubleshooting this -- can you compile a C program using those functions, using the same linker flags listed under #cgo windows LDFLAGS: -lglew32 -lopengl32?

zombiezen commented 10 years ago

Just hit this myself. I was using GLEW 1.5.7.is.1.5.2-1ubuntu4 from apt on Ubuntu, and the fix was to install libglew1.6-dev instead.