Help with a book error

Started by
4 comments, last by Will F 18 years, 7 months ago
ok i am reading that book written by the guys that run this site "Beginning OpenGL Game Programming" and i am only on the first chapter but i can't get the first chapters source file to compile. i have all the librarys -lopengl32 -lglu32 -lglut32 in the project option and i have the win32.lib in the same file that the exe will be in. the errors that i am getting are 'Exit' undeclared(first use this function) i am using Dev-C++ and here is the source code with a * beside where it has a star in devc++ please tell me some way i can get this to work. /**************************************************************************** MouseHandler() Handle mouse events. For this simple demo, just exit on a left click. *****************************************************************************/ void MouseHandler(int button, int state, int x, int y) { switch (button) { case GLUT_LEFT_BUTTON: { * Exit(0); } break; default: break; } // force a screen redraw glutPostRedisplay(); } // end MouseHandler()
-
+click here to veiw sig
+My Myspace
+[email=webmaster@hideoutgear.com]Email Me[/email]
Advertisement
Try exit(0);
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
i still get the same erorr
but now with a lowercased e
'exit' undeclared(first use this function)
-
+click here to veiw sig
+My Myspace
+[email=webmaster@hideoutgear.com]Email Me[/email]
try this one
#include <stdlib.h>
or
#include <system.h>

and then

exit(0);

i think you need the related header file for this function
get rid of the asterisk before the funtion call.
¿We Create World?
Additionally, if you haven't seen it, the errata for the book can be found here.

This topic is closed to new replies.

Advertisement