Original Post
hello all. i'm building a game with SDL and OPENGL. i'm using Dev CPP and i made a function that loads the textures for the model but i get a strange linker error take a look: here is the error: here is the code: btw in a include header i added this line: anyone has any idea what is the problem and how can i fix it ??? thanks in advance
[Linker error] undefined reference to `LoadGLTexture(char const*)'
ld returned 1 exit status
GLuint LoadGLTextures( const char *filename )
{
GLuint texture2 = 0;
SDL_Surface *TextureImage;
TextureImage = SDL_LoadBMP(filename);
glGenTextures( 1, &texture2);
glBindTexture( GL_TEXTURE_2D, texture2 );
/* Linear Filtering */
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
GL_LINEAR );
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
gluBuild2DMipmaps( GL_TEXTURE_2D, 3, TextureImage->w,
TextureImage->h, GL_RGB,
GL_UNSIGNED_BYTE, TextureImage->pixels );
SDL_FreeSurface( TextureImage );
return texture2;
}
extern GLuint LoadGLTexture( const char *filename );