🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Lesson 6

Started by
3 comments, last by Halibut05 17 years ago
Im trying to do some texture mapping on a polygon but im currently having trouble with the method to load an image and get the following errors error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C3861: 'auxDIBImageLoad': identifier not found When i run lesson6 everything works fine, but when i put my code in underneath this method instead the errors appear. Anyone able to help? - Craig
Advertisement
Can you post the code that causes the error?
This is strange, i can get rid of that error as long as i remove the line:

#include <gl\glut.h>

but of course, when i do this i get hundreds of errors saying:

error C3861: 'glutWarpPointer': identifier not found
error C2065: 'GLUT_CURSOR_NONE' : undeclared identifier

wherever i use something from the glut library.

the code this all started from is:

#include <windows.h> // Header File For Windows
#include <stdio.h> // Header File For Standard Input/Output
#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h> // Header File For The GLu32 Library
#include <gl\glaux.h> // Header File For The Glaux Library
#include <math.h>

/////////////////// variables here ///////////////////

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
}

/////////////////// more code here/////////////////////////
think i solved the problem, if i moved the

#include <glut.h>

further up the include list it works. Im not sure why this is, anyone able to fill me in as it would be nice to know?

Cheers for your offerings of help,
Craig
I believe glut.h already includes gl.h glu.h and glaux.h

There is a certain order that you need to include the openGL headers. Normally it's

windows.h
gl/gl.h
gl/glu.h

But since you are using glut (and if I remember correctly), you don't actually need to include gl.h and glu.h.

From what I have heard, glaux.h is really buggy, so I don't use it. Its bitmap loading function can be replaced (fairly easily) by an image loader of your own (or a library of some sort.)

Hope that helps a little.

This topic is closed to new replies.

Advertisement