Error with auxDIBImageLoad.

Started by
7 comments, last by Alibaro 18 years, 8 months ago
Hi to everybody, I'm trying to run an OpenGL program but every time I try to run the following error coming: error LNK2001: unresolved external symbol _auxDIBImageLoadA@4. Thanks for any help. AUX_RGBImageRec *LoadBMP(char *Filename) { FILE *File=NULL; // file handle if (!Filename) return NULL; // make sure there is a file name File=fopen(Filename,"r"); // attempt to read the file if (File) // if file exists, close and return the handle { fclose(File); return auxDIBImageLoad(Filename); //* section of the code is causing error } return NULL; // load failed } // END OF LoadBMP -------------- Yes, I've added all the Headers and Libraries but still not working. #pragma comment( lib, "opengl32.lib" ) #pragma comment( lib, "glu32.lib" ) #define WIN32_LEAN_AND_MEAN #include <windows.h> // include all the windows headers #include <windowsx.h> // include useful macros #include <mmsystem.h> // for mci commands or PlaySound #include <stdlib.h> // for rand functions #include <stdio.h> #include <math.h> #include <gl\gl.h> // OpenGL32 library #include <gl\glu.h> // GLU32 library #include <gl\glaux.h> // GLAUX library #include <glaux.h> [Edited by - Alibaro on August 2, 2005 6:52:34 PM]
Advertisement
The compiler doesn't know what auxDIBImageLoad is. Are you including the proper header or lib?
Yes, I've written all the headers, but may some are missed ?

#include <windows.h> // include all the windows headers
#include <windowsx.h> // include useful macros
#include <mmsystem.h> // for mci commands or PlaySound
#include <stdlib.h> // for rand functions
#include <stdio.h>
#include <math.h>

#include <gl\gl.h> // OpenGL32 library
#include <gl\glu.h> // GLU32 library
#include <gl\glaux.h> // GLAUX library
Never really used GLaux but I'm guessing you still need link to the library from the error
Yup, glaux.lib

I've spent more than a week for searching and finally I've got nothing.

So, please if anyone know how to solve this problem or know any useful sites.Tell me soon. Thanks for any help.


Quote:Original post by Alibaro

I've spent more than a week for searching and finally I've got nothing.

So, please if anyone know how to solve this problem or know any useful sites.Tell me soon. Thanks for any help.


You've already been answered correctly. Link to glaux.lib.
--Michael Fawcett
Alibaro, as stro sais, you need to link glaux.lib so it knows where to find the binary that matches your glaux.h include.

Add the following code below your other library links:
#pragma comment( lib, "glaux.lib" )
I've already ready slammed the plastic world through the loop to the girl in the fire. If you don't hold your colour, the sounds of life will beckon you to the terminal, by which time, you'll definately be out there.
Thanks a lot to Everybody, My program is working very fine now, Thank you again.

This topic is closed to new replies.

Advertisement