when i try to compile a program using openGL (any program), i get this error:
4 main.cpp
C:/Dev-Cpp/Include/gl/gl.h:1135: syntax error before void' 1136 c:/dev-cpp/include/gl/gl.h syntax error beforevoid’
1137 c:/dev-cpp/include/gl/gl.h
syntax error before APIENTRY' 1138 c:/dev-cpp/include/gl/gl.h syntax error beforevoid’
i get the last error some more with different numbers 1139, 1140 all the way up to 1165.
i know that the fault is not in my program (it’s from a tutorial). is this some kind of bug in opengl or so?
p.s. i’m using mingw32 compiler under windows with dev-c++
31 main.cpp
implicit declaration of function int glutInit(...)' 32 main.cppGLUT_DOUBLE’ undeclared (first use this function)
32 main.cpp GLUT_RGB' undeclared (first use this function) 32 main.cpp implicit declaration of functionint glutInitDisplayMode(…)’
33 main.cpp
implicit declaration of function int glutInitWindowSize(...)' 34 main.cpp implicit declaration of functionint glutInitWindowPosition(…)’
35 main.cpp
implicit declaration of function int glutCreateWindow(...)' 36 main.cpp implicit declaration of functionint glutDisplayFunc(…)’
38 main.cpp
implicit declaration of function `int glutMainLoop(…)’
Since you’re using glut (in Windows), make sure _WIN32 is in your list of compiler defines (and glut’s header will also try and take care of all that windows.h nonsense for you. I haven’t checked mingw thoroughly but if you drop the windows.h and let glut try and fix the defines for you, you may need to also define _STDCALL_SUPPORTED).