opengl學習之路------glGenBuffers was not declared in this scope

剛學opengl,出現glGenBuffers was not declared in this scope 錯誤,谷歌學習了一下下,記下這個錯誤和解決方案,解決問題地址如下

https://www.opengl.org/discussion_boards/showthread.php/169289-glGenBuffers%C2%92-was-not-declared-in-this-scope



glGenBuffers’ was not declared in this scope

Hi
Errormsg: ‘glGenBuffers’ was not declared in this scope

I'm using the latest openGL
3.2 Nvidia driver 32bit on openSuse 11.2
glext is included. I checked within glext.h and found it.
What else could I try?
Michael

michael@23-194-pool:~> glewinfo | grep glGenBuffer
glGenBuffers: OK
glGenBuffersARB: OK
michael@2-194-pool:~>

Re: glGenBuffers’ was not declared in this scope

Try adding the GL_GLEXT_PROTOTYPES before your include
ie
Code :
#define GL_GLEXT_PROTOTYPES
...
#include <glext.h>
or if using gcc compiler just add -DGL_GLEXT_PROTOTYPES to your compile command

I see you are using glewinfo -- excellent. Why not use it also within your code since it is more general approach that helps with openGL extensions see GLEW and it's Basic Usage. Note with GLEW you don't need to worry about adding GL_EXT_PROTOTYPES define macro. It takes care of that and lots of other things for you.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章