texture mapping problem
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
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
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
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
// 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
// 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
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
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?
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.
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
---
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement