glGenBuffers was not declared in this scope

Started by
30 comments, last by dpadam450 13 years, 2 months ago
Well I am trying to learn Vertex Arrays and VBOs. I didn't really want to learn VAs but I tried them anyway and couldnt draw anything. I think that because its deprecated. But then I tried VBOS and I am trying to use the GenBuffer,BindBuffer, etc. for using VBOS and it gives me these errors:
glGenBuffers not declared in this scope
GL_ARRAY_BUFFER not declared in this scope
glBindBuffer not declared in this scope
GL_DYNAMIC_DRAW not declared in this scope
glBufferData not declared in this scope

I am using opengl 3.3 and I have included gl.h and glu.h and windows.h.

I only have probelms with these functions..
Advertisement
You need the extensions. Google glew (glew.sourceforge.net). I think thats the address still. Everything in openGL is extended. gl.h is the original standard, every addition such as VBO's are separate for compatability.

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


You need the extensions. Google glew (glew.sourceforge.net). I think thats the address still. Everything in openGL is extended. gl.h is the original standard, every addition such as VBO's are separate for compatability.


Thanks! Now I have another problem though. I downloaded glew but now I am getting this error:
error: cannot convert 'GLfloat' to 'const GLvoid*' in argument passing

on this function: glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat)*3, vbodat[0], GL_DYNAMIC_DRAW);
vbdat[0] is a float, you want to pass the address of your data ........., &(vbodat[0])

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


vbdat[0] is a float, you want to pass the address of your data ........., &(vbodat[0])


Oh thanks! But now I am getting this:
|undefined reference to `_imp____glewGenBuffers'
same error for bindbuffer and bufferdata.
I have the lib in lib directory of codeblocks.
I linked the lib like this in other linker options: -lglew32
I have the dll in the folder too...
I have also tried linking it with link libs and found the file directly..
I'm just using glew32.lib, dont know if they changed the name. You need to make sure it knows that path, otherwise just copy the whole filepath (+ .lib) and see if that works.

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


I'm just using glew32.lib, dont know if they changed the name. You need to make sure it knows that path, otherwise just copy the whole filepath (+ .lib) and see if that works.


Ya I have a glew32.lib and a glew32s.lib for static.. I dont know why it isnt linking.
glewGenBuffers its just glGenBuffers

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


glewGenBuffers its just glGenBuffers


Ya I know, I think I am just linking wrong or their is something wrong with my code. How do u link it?
I have the dll's and the libs... Dont I just need to have the dll and the header included to use this? Can I avoid libs?
I use visual studio and just have the exact file path in the linker box. Try commenting out your glew related code, and see if you get an error that it cant find glew32.lib.

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

This topic is closed to new replies.

Advertisement