PDA

View Full Version : file not defined



04-22-2004, 04:55 PM
im using dev c++ and when i compile my code it gives me this message

31 main.cpp
`File' undeclared (first use this function)
31 main.cpp
(Each undeclared identifier is reported only once
31 main.cpp
for each function it appears in.)
38 main.cpp
implicit declaration of function `int fopen(...)'

and here is my code for it

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
}

any help would be nice, thxs in advance

chowe6685
04-22-2004, 08:11 PM
I believe File should be FILE

04-23-2004, 05:08 AM
yea i had it that way, i guess i changed it before posting it, sorry, so file=FILE

miko
04-23-2004, 09:26 AM
try to #include <stdio.h> and also try this (http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=c+programming+tutorial&btnG=Google+Search) :p

04-23-2004, 08:12 PM
ok ur suggestion worked, but now its saying that glaux.h is missing? but if i compile other files it'll work(other thatn the one im trying), is there anywhere i can download glaux and where would i put it, should i just try updating dev c++

04-23-2004, 08:15 PM
checked up too see if glaux was still in file and it is, its in include/gl/glaux.h, so mabye a update is in order?

04-23-2004, 11:23 PM
Hmmm of course you have to include both stdio.h and glaux.h.

I recommend a little more C/C++ practice before you start with OpenGL.

ZbuffeR
04-24-2004, 01:26 AM
By the way, try to find what depends on glaux.h and replace it by something better, glaux dates from before stone age and is not maintained anymore.

04-24-2004, 01:30 PM
replace it with what? like what would u sugggest?

04-24-2004, 03:59 PM
Two words: GLU & GLUT
THe first is the utility library and the other is the utility toolkit. Also glut takes care of window initialization for you as well as other nice stuff. GLU should come with OpenGL I think, as for glut for windows go http://www.xmission.com/~nate .