glActiveTexture declaration

I am using SDL2 with CodeBlocks/MinGW/gcc, and I have a problem with glActiveTexture. If I call this function without declaring it, it says “undefined reference to `glActiveTexture at 4’”. If I declare it as PFNGLACTIVETEXTUREPROC glActiveTexture, it says “‘glActiveTexture’ redeclared as different kind of symbol”.

The way I fixed it is by going into SDL_opengl.h and deleting line 2019:
GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);

Now I do
PFNGLACTIVETEXTUREPROC glActiveTexture = (PFNGLACTIVETEXTUREPROC) SDL_GL_GetProcAddress(“glActiveTexture”);
and everything works fine.

But I’m pretty sure this shouldn’t happen. Every other OpenGL function is either loaded automatically or I can declare it no problem. For some reason only glActiveTexture is giving me a headache.
Is this a bug with SDL2 or my OpenGL driver, or am I doing something wrong?

MindFlyer wrote:

The way I fixed it is by going into SDL_opengl.h and deleting line 2019:
GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);

Typo. It’s line 1871:
GLAPI void GLAPIENTRY glActiveTexture( GLenum texture );

Same problem

I crosscompile on Debian/Linux for Windows with mingw-w64,

For unix by default SDL auto declarate

for example:

glTexImage3D()
glActiveTexture()
glCompressedTexImage2D()

but it broken for mingw becouse libopengl32 not contains symbols. but If I declare it i take redeclaration error WTF developers =)))) ( no agry I Love SDL developers) Mybe need for mingw cross target add in SDL_opengl.h macro like

#if !defiled(__MINGW32__) 
declarate_mingw_unsupport_gl_functions_this_
#endif

On linux we just compile and use functions, on windows mingw and or linux mingw cross compile
we use SDL_GL_GetProcAddress for this functions

In any case, it’s just impossible to leave it like that because in the current version it is simply impossible to use some functions without correcting the SDL header files

You can see what supports mingw on linux

cd /usr/x86_64-w64-mingw32/lib
nm libopengl32.a | grep T

All that is missing here should be in the SDL_opengl header file is in !defined(__MINGW32__)

I say this because the SDL provides an assembly under mingw

Who has any ideas on this?

I apologize for my English; I speak it poorly

someone can can tell what to do right?