0
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)’

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

0
101 Jan 18, 2004 at 14:21

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

0
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>

0
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.

0
101 Jan 19, 2004 at 16:54

0
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:

0
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.

0
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

0
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.