Skip to main content
gamedev.net
🔒 Locked

strange devcpp linker error

Started by mc30900 Sep 3, 2006 at 11:40 AM 1 replies 550+ views
Original Post
mc30900
mc30900
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:


  [Linker error] undefined reference to `LoadGLTexture(char const*)' 
  ld returned 1 exit status 



here is the code:

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;
}


btw in a include header i added this line:


extern GLuint LoadGLTexture( const char *filename );	





anyone has any idea what is the problem and how can i fix it ??? thanks in advance
Scet
Scet
The function name is LoadGLTextures not LoadGLTexture.
mc30900
mc30900
lol thanks a lot!!!!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.