DEV-C++ Errors On All PhotoTypes...


I am friarly new to C++ and OpenGL… Though I know a good deal… I have never had this problem before and now it happens every time…

I get errors similar to:
1142 C:\Dev-Cpp\include\gl\gl.h
syntax error before `void’

for all the gl.h and the glu.h header files… I did not touch these files… It dose it on all the DEV-C++ compilers… When the code is compiled on VC6 compiler it dose not get these erroes…

Yes I have linked the librays…

Please any help would be grate full!


Hi !

Ohhh mighty Bill !!!

Mr Gates likes to mess up our lives all the time, try to include windows.h before you include gl.h, that should do the trick.

Microsoft has put a lot of windows specific declarations in their gl.h so you must include windows.h to make it work.


Thanks!!! That worked…

But I though OpenGL worked on alll OS…

What do I do if I am codeing for Linux?


when coding with linux, don’t include windows.h.


sorry… you can simply include gl.h and start, once you have something to render on, to get this, you probably need motif and/or xlib, there are some tutorials, it’s quite easy.


or glut, of course, although I would not recommend it.

#ifdef __windows
#include <window.h>