VBO's, what lib/header needed?(Solved)

Started by
13 comments, last by smitty1276 17 years, 4 months ago
I have included everything period. Nothings working. Im going to try .NET 2003

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Advertisement
Ok I'm just sayin F it to GLee cuz it is the same problem.

Right now I include everything, but when I call glGenBuffers() or any other extensions, i get a linker error saying it cannot find that function.

I have included <gl/glew.h> <gl/glut.h> in that order.

My linker

-glew32.lib

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Quote:Original post by dpadam450
Ok I'm just sayin F it to GLee cuz it is the same problem.

Right now I include everything, but when I call glGenBuffers() or any other extensions, i get a linker error saying it cannot find that function.

I have included <gl/glew.h> <gl/glut.h> in that order.

My linker

-glew32.lib


That is because no lib including opengl32.lib glu32.lib glut32.lib (I don't know about glew32.lib) has glGenBuffers() function exported. For that function and other extension functions to work, you will have to dynamically load those functions. You can do this yourself by GetProcAddress() or wglGetProcAddress(), but the OpenGL specification has 100s of extensions. That means you will have to do the same thing 100s of times for each extension that you plan to use. GLee and glext do all this for you. That is all that they do. They are not libraries (.lib files). Since you are getting linker errors, you are most likely you are missing some other library like kernel32.lib or user32.lib or maybe there is some other problem besides the linker one.
++ My::Game ++
If it is a compile error, your glext.h is outdated and does not have the function defined.
If it is a linker error, you are not including opengl32.lib.

Do not blame the libraries if you are not setting up your project correctly. I dont know if glext.h is provided by Glew or GLee, if it is make sure you are using the one they provide. Better still overwrite the older glext.h with the ones these libraries provide.
Glew or GLee will load any or all extensions you need.

You have to include glew.h first.

You have to call glewInit() before using any extensions... this initializes function pointers for the extensions (I think... never really looked).

You have to link to glew32.lib (or glew32d.lib if you want debug stuff). You also need to link to glut32.lib and the GL libs (glut.h, however, has a few pragmas that should link to it in VS).

And I think that glew DOES have all of the extensions defined in glew.h, so you probably don't need glext.h, but it can't hurt to have it.

EDIT: Sorry, just saw the "Solved" tag on the topic title. What did you do to get it working, out of curiosity?

This topic is closed to new replies.

Advertisement