This is some code I wrote while learning OpenGL OpenGL in Linux using Glut Configure the OpenGL environment $ sudo apt-get install freeglut3-dev Use the following two Header files in the OpenGL code <GL/glut.h> <GL/gl.h> Compile OpenGL code $ g++ <> -lglut -lGLU -lGL Run the executable ./a.out