What is OpenGL
OpenGL is an free graphics library written in c. This is available for various platforms including C, C++,Java,Android etc. In this article we explain in detail how to install and set up OpenGL library in your Ubuntu 14.04 environment.Before we start setting up the software, We must try to download the required Packages which are explained in the steps bellow.
Setup OpenGL with Ubuntu
Install the mesa-common-dev and freeglut3-dev libraries in your Ubuntu systems. By using the Commands bellow.
$ sudo apt-get install mesa-common-dev
$ sudo apt-get install freeglut3-dev
Once you set up these libraries successfully, You need to just configure your CodeBlocks IDE to start developing the OpenGL project. Before you start developing , first download the codeblocks IDE using the following commands.
$ sudo apt-get install codeblocks
Configure Your CodeBlocks IDE For OpenGL
Open the CodeBlocks IDE
Once you are done opening the CodeBlocks, Open the new project, fill the details of the application you are going to create.
NewProject -> OpenGL project-> Fill Project Details ->Select the Compiler (eg : GCC ) -> Finish the setup
Configure Your Code Blocks To Link All The Required Libraries
Perform the Following tasks as shown in bellow images to configure and to add the required flags inorder to make your linker add the required object libraries during linking.
Project Properties -> Build Settings -> Build Options -> Linker Setting -> Other Linker Options Add the following flags as specified bellow along with ‘ – ‘ sign -lGL -lGLU -lglut