How to Install OpenGL on Ubuntu Linux

What Is OpenGL?
OpenGL is a Graphics rendering API which is operating system independent, window system independent and has high-quality color images composed of geometric and image primitives.
OpenGL APIs can use following …

Now lets see How to install OpenGL on out Ubuntu OS.

Now because GLUT (OpenGL Utility Toolkit) depends upon OpenGL and a number of other related libraries, if we install GLUT then OpenGL will be automatically be installed.

Run the following commands to install OpenGL.

Now to test if OpenGl libraries are working fine on our Linux, we will create a C++ program and test it.

So create a following C++ Program.

Now give the command below to compile your code.

Now run your OpenGl program with following command










If a window pops up when you run the program, then OpenGL is working on your Ubuntu OS.

Partner Sites

  • Thanks very useful links I wish you could post or make like an RSS feed embedded on my site I will tweet this page. Thanks again

  • Luis Fernando Zavala Camacho

    also add “-lm” to add the math library