opengl学习之路------glGenBuffers was not declared in this scope

来源:互联网 发布:联通免流软件 编辑:程序博客网 时间:2024/06/05 08:37

刚学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 extensionssee 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.

0 0
原创粉丝点击