Installation guide of OpenGL API in Ubuntu/Fedora

Many would have installed OpenGL, an API(Application Programming Interface) for writing applications that produce 2D and 3D Computer Graphics.


Installation of OpenGL in Linux platform is different and installation in WINDOWS is different. So, some set of steps has to be followed while installing OpenGL in LINUX platform.


Steps goes like this:--


First we need to install the IDE(Integrated development environment). Here, we use CODE::BLOCKS IDE.  To install, open the terminal and type the following command.


sudo apt-get install codeblocks



What actually happens when u execute this command?

The application name specified in the command will be checked in the repository and then the application gets installed by downloading the installation files from the internet or from the pre-installed folder which contains installation files.


Now, IDE is ready but we have to install GLUT(OpenGL Utility Toolkit).  We have to pay for installing GLUT but FREEGLUT available in the net. So, we can install this by the following 2 commands. Enter these following commands in the terminal.



sudo apt-get install freeglut3

sudo apt-get install freeglut3-dev



GLUT files will be installed in /usr/include/GL/   directory.



Once the API is successfully installed, next step is to configure it.

Steps:--



  • Go to Applications-->Programming-->Code::Blocks IDE

  • Then, go to Settings-->Compiler and debugger.

  • Open Linker settings tab. Then, in the bottom, you can see the ADD button. Click on Add button and then type glut and click on ok.  In the same way, type as GLU and GL in Linker settings tab.



FreeGLUT is installed now.


Now API is ready to execute the programs.


Type the program and if you come up with any problem saying cannot find lXxf86vm, then no need to worry. Just go to terminal and type the following command and you are done with that.


sudo apt-get install libXxf86vm-dev


Now, run the program and it must execute.


Any problem or clarifications regarding this post can be posted in the comment panel or email to srikanth.gundaz@gmail.com.



Thank you. :)