Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 8 of 8

Thread: Problems loading a bitmap

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2006
    Location
    Oklahoma
    Posts
    4

    Problems loading a bitmap

    Hi all,

    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?

    Code :
    AUX_RGBImageRec *LoadBMP(char *Filename)

  2. #2
    Junior Member Regular Contributor songho's Avatar
    Join Date
    May 2003
    Location
    Canada
    Posts
    242

    Re: Problems loading a bitmap

    Hi BrandonLP,
    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.

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2006
    Location
    Oklahoma
    Posts
    4

    Re: Problems loading a bitmap

    I have the headerfile in the include\GL folder, but it still doesn't seem to be working.

  4. #4
    Junior Member Regular Contributor songho's Avatar
    Join Date
    May 2003
    Location
    Canada
    Posts
    242

    Re: Problems loading a bitmap

    Do you also have the library file? (glaux.dll or glaux.lib)

  5. #5
    Junior Member Newbie
    Join Date
    Oct 2006
    Location
    Oklahoma
    Posts
    4

    Re: Problems loading a bitmap

    I have them, but they're in a directory for Win2k Server SDK. Where should I copy them to?

  6. #6
    Junior Member Regular Contributor songho's Avatar
    Join Date
    May 2003
    Location
    Canada
    Posts
    242

    Re: Problems loading a bitmap

    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++):
    Code :
    // 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.

  7. #7
    Junior Member Newbie
    Join Date
    Oct 2006
    Location
    Oklahoma
    Posts
    4

    Re: Problems loading a bitmap

    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:
    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.

  8. #8
    Advanced Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    744

    Re: Problems loading a bitmap

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •