PDA

View Full Version : include GLUT in miltiple source files



deadlogic
03-14-2004, 04:29 PM
hi
this may sound pretty silly but i've spent last 2 hours trying to deal with. so I'm writing a openGL app using GLUT and borlands free C++ compiler. my entire program was in a single CPP file but now it is becomming more and more complex and i want to put all classes in separate files. the problem is that when i include GLUT.H in more then one file in my project, the compiler generates a large list of errors saying that some stuff is already been defined. can anyone tell what is going on and how can i get rif of it...? thanks

MrShoe
03-14-2004, 07:44 PM
Ummm, I have NO idea why your GLUT headers arent protected, they SHOULD be. Anyway, open up the GLUT header and put in if it isnt ther already

#ifndef __GLUT_H__
#define __GLUT_H__

// rest of glut header

#endif