0

I am trying to render a cube in opengl using vertex array objects. The same code works on a linux box but doesnt work on a windows machine. I get unresolved external error while using glGenVertexArrays and glBindVertexArray.

glewInfo.exe reports glGenVertexArrays and glBindVertexArray are usable:

GL_ARB_vertex_array_object:                                    OK 
---------------------------
  glBindVertexArray:                                           OK
  glDeleteVertexArrays:                                        OK
  glGenVertexArrays:                                           OK
  glIsVertexArray:                                             OK
Richard Macwan
  • 422
  • 1
  • 5
  • 19
  • How do you query those extensions in your code? Do you use a loader library? If so, which one? If not, how are you doing it? – derhass Dec 01 '13 at 19:39
  • Like I said, the above result is the output of glewinfo.exe. I did not need to verify these extensions as the code directly worked on my linux box. I also checked that the graphics drivers on the windows machine are outdated(nvidia gt350m). Maybe that could be the problem? TBH, I do not have much time to test this since the windows machine is not mine. But I will try and check the extensions from within my application(it's a qt application) – Richard Macwan Dec 02 '13 at 10:03
  • Btw, can it be as simple as glEnable(GL_ARB_vertex_array_object); ? I will try that as soon as I get my hands on the windows machine. – Richard Macwan Dec 02 '13 at 10:16
  • Obviously not! But it was worth a shot! – Richard Macwan Dec 02 '13 at 11:56
  • Well. The fact that you use the `glewinfo` binary does not imply that you use glew also in your code base. I just wanted to make sure. If you use glew and get those unresolved linker errors, there is something wrong with with lniking, and no runtime code can fix that. Note then when you use glew as a static library (or directly add the glew sources to your code) on windows, you have to `#define GLEW_STATIC` before including `glew.h`. – derhass Dec 02 '13 at 14:52
  • I guess I mixed up some things. I had switched from using glew to using qt functions because qt's opengl does not mix well with glew. This might mean that qt's libraries are somehow not using the correct driver. Right? – Richard Macwan Dec 03 '13 at 10:07

1 Answers1

1

Likely you're not using the correct opengl.dll lib. Windows comes with a software renderer by default, you might be using that one.

Check out the websites of your graphics card vendor for the proper library.

Sorin
  • 11,863
  • 22
  • 26
  • In the case of having no GL driver for the GPU installed, glewinfo would not be able to report `GL_ARB_vertex_array_object` as present. since the MS implementation only supports GL 1.1. Also note that on windows, `opengl32.dll` is always the correct library to use. The GPU vendors dlls are registered as ICD and opengl32.dll will redirect the calls to the vendor's lib. – derhass Dec 01 '13 at 20:29