error when using extensions (glActiveTextureARB)

Aceada8b6ecf98e52d68cb313fc7648a
0
cruppstahl 101 Jan 18, 2004 at 11:53

Hi,

i try to write a small openGL application which uses multitexturing. I use Linux. But either i get compiler errors or i get linker errors saying that glActiveTextureARB is either not declared or not defined.

i have tried two things:

#include <GL/glext.h>
void main () {
...
glActiveTextureARB(GL_TEXTURE0_ARB);
...
}

Gives me: error: `glActiveTextureARB’ undeclared (first use this
function)

So i tried to declare glActiveTextureARB:

void glActiveTextureARB(GLenum); // the declaration
void main()
{
...
glActiveTextureARB(GL_TEXTURE0_ARB);
...
}

Now the linker complains: undefined reference to `glActiveTextureARB(unsigned)’

my linker command:
g++ -rdynamic -g -o ruckel .build-debug/font.o .build-debug/main.o .build-debug/texture.o .build-debug/refcounted.o .build-debug/texturecore.o .build-debug/texturecache.o .build-debug/fontcore.o .build-debug/fontcache.o .build-debug/window.o .build-debug/thread.o .build-debug/scheduler.o .build-debug/testthread.o .build-debug/localinput.o .build-debug/profile.o .build-debug/shadercore.o .build-debug/shadercache.o .build-debug/shader.o .build-debug/extension.o -lGL -lGLU -lSDL_mixer -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread -lSDL_image

The strange thing is: nehe’s lesson 22 (SDL/Linux port) compiles, but the multitexture tutorial of gametutorials.com gives me compiler errors, too (the same as above). And i can’t find a difference between their code and mine…

What am i doing wrong?

Thanks
Chris

8 Replies

Please log in or register to post a reply.

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Jan 18, 2004 at 14:21

does the nehe tut come with it’s own glext header ?

Aceada8b6ecf98e52d68cb313fc7648a
0
cruppstahl 101 Jan 18, 2004 at 15:14

no, it includes <GL/glext.h>. I include the same files, in the same order:
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glext.h>
#include <SDL.h>

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Jan 18, 2004 at 15:24

hehe,
look into your SDL_opengl header if you use it. you will find that it also has some extensions defined in there. so either you deactivate them by defining… can’t remember. look at the top of the header. it should say something like SDL_NOEXT or similar. or you add you extension to that header. i’d prefer the first.

0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Jan 19, 2004 at 16:54

try using SDL_GetProcAddress

Aceada8b6ecf98e52d68cb313fc7648a
0
cruppstahl 101 Jan 24, 2004 at 09:32

anubis, i have played with SDL_GL_NOEXT, i have used SDL/SDL_opengl.h instead of the standard GL headers, but it didn’t help. thanks nevertheless.

Baldurk, SDL_GetProcAddress works!! Finally. And the SDL documentation about SDL_GetProcAddress even has an example for getting the glActiveTextureARB-Extension :-P

but it sucks, i have discovered that my GeForce 4 MX 440 only has 2 texture units… i thought it had more… i wanted to write a small shader system with multitexturing, but now i guess i also have to use multipass texturing… :blink:

0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Jan 24, 2004 at 16:35

I thought that the GeForce 4 Mx series was quite rubbish. I may be mistaken, but I think the stats are actually worse than a GeForce 3 Pro.

067ff4cc33781abd89ee50b0bf929f6a
0
Slash 101 Jul 23, 2004 at 04:12

@cruppstahl

anubis, i have played with SDL_GL_NOEXT, i have used SDL/SDL_opengl.h instead of the standard GL headers, but it didn’t help. thanks nevertheless.

Baldurk, SDL_GetProcAddress works!! Finally. And the SDL documentation about SDL_GetProcAddress even has an example for getting the glActiveTextureARB-Extension :-P

but it sucks, i have discovered that my GeForce 4 MX 440 only has 2 texture units… i thought it had more… i wanted to write a small shader system with multitexturing, but now i guess i also have to use multipass texturing… :D

[snapback]7071[/snapback]

Two texture units should be enough for experimentations, and btw, even if you tried you wouldn’t be able to use Geforce 4 MX shader system simply because there isn’t any shader system since its a DX7 card.

-Zul

2b97deded6213469bcd87b65cce5d014
0
Mihail121 102 Jul 23, 2004 at 05:53

You’re not mistaken alright…. i happen to have 4 MX and it’s really hell. But i gotta be somewhat happy ‘cause it has atleast regcoms.