>
> Does your header file require anything from <gl.h>? If so, put it in
> your header file; if not put it in the cpp file.
>
> > In my [c-like] main [or root] program I include #myClass.h, but I the main
> > also uses glut so I must include
> > <glut.h>, which itself includes <gl.h>. Have I included gl.h twice?
>
> Yes (presuming glut.h is your header file,) but the contents of that
> file will (should) only be parsed once.
>
> > Is this bad?
>
> Not necessarily.
>
Okay, Here is my problem. There seems to be a problem with the order of
includes when using <glut.h>; if I include it last it works otherwise there is
a conflict between definitions of `exit' I think.
Mymain uses glut and myClass. I include <glut.h> in myMain and also include
"myClass.h". There are no includs in myClass.h; myClass.cpp, though, must use
openGL, so myClass.cpp has include <gl.h> which is included in glut.
Now I get the error C2381:
'exit' : redefinition; __declspec(noreturn) differs
c:\a_glut\include\gl\glut.h(146) : see declaration of 'exit' and:
warning C4985: 'exit': attributes not present on previous declaration.
c:\a_glut\include\gl\glut.h(146) : see declaration of 'exit'
The only fix I can find on the web is to modify glut or openGl exit feature.
That is not acceptable. What am I missing?