This is just a quick supplement to my post on OpenGL on OSX.
To get the same code running under Linux, I simply changed the includes to the following:
#include <GL/glut.h> #include <GL/gl.h>
…and compiled the code using the following line in the terminal:
gcc glutTest.c -lGL -lGLU -lglut
(Note that I’m using gcc because I’m now compiling a .c file. If it were a .cpp file, I would use g++ instead)
If you’re getting errors such as ” has incomplete type” or “invalid use of GLvoid”, simply replace all instances of GLvoid with just void, and it should work.