PDA

View Full Version : OpenGL glActiveTexture is missing ...



abominable
08-26-2010, 12:18 PM
Hello everyone.

I have ubuntu installed. And I am trying an OpenGL application. Far to know everything was ok. But today while trying multitexturing, I faced the following error.
error: %glActiveTexture% was not declared in this scope.

I checked on the GL/gl.h file [that I had included] and found the following declarations ::
GLAPI void GLAPIENTRY glActiveTexture( GLenum texture );
GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);

But I don't know for what reason, the program doesn't compile.

In my searching, found a proposal to reinstall the mesa-common-dev package. But didn't fix the problem.

If you have any idea, would be really helpfull.

ravage
08-26-2010, 02:37 PM
glActivceTexture is spelled wrong...
glActiveTexture you have a 'c' that shouldn't be there.

abominable
08-26-2010, 04:04 PM
Sory about that. I couldn't copy paste from my ssh-konsole, so I wrote it my self. The spelling mistake is not in my code.

Dark Photon
08-27-2010, 06:30 AM
Hello everyone.

I have ubuntu installed. And I am trying an OpenGL application. Far to know everything was ok. But today while trying multitexturing, I faced the following error.error:

%glActiveTexture% was not declared in this scope.

I checked on the GL/gl.h file [that I had included] and found the following declarations
gl.h should not have this prototype. glext.h should have prototypes, and should be this file here glext.h (http://www.opengl.org/registry/api/glext.h) directly off the the OpenGL Registry (http://www.opengl.org/registry) page on this site. gl.h includes glext.h if you define GL_GLEXT_PROTOTYPES.

So all you should have to do is this:



#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>


Then just reference glActiveTexture.

Henry Rust
08-27-2010, 09:42 AM
Hello everyone.

I have ubuntu installed. And I am trying an OpenGL application. Far to know everything was ok. But today while trying multitexturing, I faced the following error.error:

%glActiveTexture% was not declared in this scope.

I checked on the GL/gl.h file [that I had included] and found the following declarations
gl.h should not have this prototype. glext.h should have prototypes, and should be this file here glext.h (http://www.opengl.org/registry/api/glext.h) directly off the the OpenGL Registry (http://www.opengl.org/registry) page on this site. gl.h includes glext.h if you define GL_GLEXT_PROTOTYPES.

So all you should have to do is this:



#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>


Then just reference glActiveTexture.


The gl.h provided by mesa seems not to include glext.h when GL_GLEXT_PROTOTYPES is defined. Instead you have to define GL_GLEXT_LEGACY if you want gl.h to include glext.h

So you may also need to include glext.h

abominable
08-27-2010, 09:49 AM
After all day search finally found it.

I am using CUDA, and CUDA makefile for compiling my source code. For some reason CUDA uses its own include/GL/<GL_FILES>. And its gl.h wasn't declaring glActiveTexture(). Instead have to include glew.h.

Now I have bumped with segmentation faults whenever I call glActiveTexture. But I hope that I will solve it.

Thanx all of you for your time and proposals.