View Full Version : Problems loading a bitmap
10-27-2006, 09:50 AM
I've recently decided to learn about OpenGL in an attempt to create a nice looking program for extra credit in my GUI/OOP class. I've been going through the tutorials @ http://nehe.gamedev.net/ but there is a problem beginning at Lesson 6. The code given to load a bitmap gives a compile error stating "expected constructor, destructor, or type conversion before '*' token. Below, I've listed the line generating the error. Any ideas?
AUX_RGBImageRec *LoadBMP(char *Filename)
10-27-2006, 11:01 AM
I believe AUX_RGBImageRec is a part of glaux library. And, glaux library is now obsolete. So, it is better not to use glaux.
However, if you still want to work with it (at least to compile the Nehe tutorial), search for glaux.h and its library (dll or lib). If you cannot find one, let me know.
10-27-2006, 11:20 AM
I have the headerfile in the include\GL folder, but it still doesn't seem to be working.
10-27-2006, 12:11 PM
Do you also have the library file? (glaux.dll or glaux.lib)
10-27-2006, 12:35 PM
I have them, but they're in a directory for Win2k Server SDK. Where should I copy them to?
10-27-2006, 01:02 PM
Copy "glaux.lib" into the same folder where your source codes are. Then add the following line at the top of your source code(C/C++):
// link static glaux library
#pragma comment(lib, "glaux.lib")
// include headers
...It is static library and merged into exe, so you don't need the DLL to run your executable.
10-27-2006, 01:39 PM
Still getting this error:
66 C:\Documents and Settings\Brandon\Desktop\opengl\lesson26\Lesson26. cpp expected constructor, destructor, or type conversion before '*' token
Here's the entire block of code:
AUX_RGBImageRec *LoadBMP(char *Filename) // Loads A Bitmap Image
FILE *File=NULL; // File Handle
if (!Filename) // Make Sure A Filename Was Given
return NULL; // If Not Return NULL
File=fopen(Filename,"r"); // Check To See If The File Exists
if (File) // Does The File Exist?
fclose(File); // Close The Handle
return auxDIBImageLoad(Filename); // Load The Bitmap And Return A Pointer
return NULL; // If Load Failed Return NULL
}Also, if this method is antequated, I wouldn't be against learning a new way to do it.
10-27-2006, 02:40 PM
We at NeHe are aware of the problem, the original lesson was written a long time ago, we have since rewritten it totally, it's now a sweet and lightweight tga loader (even i who wrote it was amazed by it's sweetness), but it's yet to be released, so in the meantime we made this temporary fix.
glAux fix (http://www.gamedev.net/community/forums/topic.asp?topic_id=275238)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.