texture mapping problem

Started by
8 comments, last by muhid 21 years, 7 months ago
i copied the texture mapping tutorial example and when i compile i get the error Unresolved external ''auxDIBImageLoadA'' referenced from C:\C++\CUBE.OBJ can someone tell me whats wrong? Thanks
Advertisement
What compiler are you using?

Do you have glaux.h/.lib included?

The glaux utility is considered... well not the best thing around. It''d be a lot better (IMO) if you took the time and wrote your own bitmap loading code and used it later on - it''s not that great a hassle...

Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
i copied the example from nehe''s tutorial. here is the program with the main functions.

// Function to load a file
AUX_RGBImageRec *LoadBMP(char *Filename) {
FILE *File=NULL;
if (!Filename) {
return NULL;
}
File=fopen(Filename,"r");
if (File) {
fclose(File);
return auxDIBImageLoad(Filename);
}
return NULL;
}

int LoadGLTextures()
{
int status=FALSE;
AUX_RGBImageRec *TextureImage[1];
memset(TextureImage,0,sizeof(void *)*1);
if (TextureImage[0]=LoadBMP("c:/C++/a.bmp")) {
status=TRUE;
glGenTextures(1, &texture[0]);

glBindTexture(GL_TEXTURE_2D, texture[0]);
//Generate the texture image
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX,
TextureImage[0]->sizeY, 0, GL_RGB,
GL_UNSIGNED_BYTE, TextureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);// Linear Filtering
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
}
return status;

}

int main( int argc, char* argv[] ){
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_DOUBLE | GLUT_DEPTH | GLUT_RGB );
glutCreateWindow( "example" );
glutReshapeFunc( reshapeFunc );
glutDisplayFunc( DisplayFunc );
if (!LoadGLTextures()) // Jump To Texture Loading Routine
{
return FALSE; // If Texture Didn''t Load Return FALSE ( NEW )
}
glEnable(GL_TEXTURE_2D);
glutKeyboardFunc( keyboard );
glClearColor( 0.2f, 0.36f, 0.5f, 0.5f );
glEnable( GL_DEPTH_TEST );
glutMainLoop();
return 0;
}

and i still get the same error message about unresolved external ''auxDIBImaeLoadA'' referenced from C:\C++\CUBE.OBJ
i copied the example from nehe''s tutorial. here is the program with the main functions.

// Function to load a file
AUX_RGBImageRec *LoadBMP(char *Filename) {
FILE *File=NULL;
if (!Filename) {
return NULL;
}
File=fopen(Filename,"r");
if (File) {
fclose(File);
return auxDIBImageLoad(Filename);
}
return NULL;
}

int LoadGLTextures()
{
int status=FALSE;
AUX_RGBImageRec *TextureImage[1];
memset(TextureImage,0,sizeof(void *)*1);
if (TextureImage[0]=LoadBMP("c:/C++/a.bmp")) {
status=TRUE;
glGenTextures(1, &texture[0]);

glBindTexture(GL_TEXTURE_2D, texture[0]);
//Generate the texture image
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX,
TextureImage[0]->sizeY, 0, GL_RGB,
GL_UNSIGNED_BYTE, TextureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);// Linear Filtering
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
}
return status;

}

int main( int argc, char* argv[] ){
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_DOUBLE | GLUT_DEPTH | GLUT_RGB );
glutCreateWindow( "example" );
glutReshapeFunc( reshapeFunc );
glutDisplayFunc( DisplayFunc );
if (!LoadGLTextures()) // Jump To Texture Loading Routine
{
return FALSE; // If Texture Didn''t Load Return FALSE ( NEW )
}
glEnable(GL_TEXTURE_2D);
glutKeyboardFunc( keyboard );
glClearColor( 0.2f, 0.36f, 0.5f, 0.5f );
glEnable( GL_DEPTH_TEST );
glutMainLoop();
return 0;
}

and i still get the same error message about unresolved external ''auxDIBImaeLoadA'' referenced from C:\C++\CUBE.OBJ

and by the way i am using bcc32 compiler. i have glaux.lib/.h
quote:Original post by muhid
and by the way i am using bcc32 compiler. i have glaux.lib/.h


are you sure the glaux.lib is in OMF format? Whatever your code is, the problem probably lies somewhere else - the compiler cannot find the function body for auxDIBImageLoad.

Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
If you''re using the command line compiler then you''ll need to explicitly include the glaux library when you compile (i.e. bcc32 -W lessonXXX.cpp glaux.lib)

Enigma
i have a glaux.lib file in my lib folder but when i compile like this
bcc32 cube.cpp glaux.lib glut32.lib i get the error
glaux.lib contains invalid OMF record, type 0x21 (possibly COFF)

what the heck does that all mean? and how do i fix it?
i fixed the COFF file to OMF using coff2omf.exe. But when i compile i still get the error that i first got from the start.
Can you post the full compiler error output?

Enigma
This might help. Includes source code.

---
Make it work.
Make it fast.

"I’m happy to share what I can, because I’m in it for the love of programming. The Ferraris are just gravy, honest!" --John Carmack: Forward to Graphics Programming Black Book
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]

This topic is closed to new replies.

Advertisement