Kamis, 06 Desember 2012

OpenGL Dev: Ubuntu Edition

Nowadays, ubuntu is one of many (debian based) Linux distribution which has been used by everyone over the world, especially for IT specialists and FOSS (Free/Open Source Software) users. So, in this post, I assume you are using the Ubuntu as your operating system base. FYI: This written-post was powered by Ubuntu 12.10 Quantal Quetzal.

The IT specialist, especially programmers or student who takes the programming course, will need so many development tools installed on his/her PC/OS. In this post, I will show you how to install the C++ compiler and OpenGL library under Ubuntu, so that you can code your C++ based OpenGL project under Ubuntu Linux. Okay, turn this way!! :)

Installing the Compiler and OpenGL Libray

1. Install g++ (GNU C++ compiler) with its dependencies
    $ sudo apt-get install g++

2. Install freeglut3 (OpenGL Utility Toolkit + development files) with its dependencies
    $ sudo apt-get install freeglut3 freeglut3-dev

Compiling OpenGL C++ Source Code

The compiling process needs you to put some additional options when you compile the OpenGL based project, i.e. -lGL -lGLU -lglut

$ g++ source_file.cpp -lGL -lGLU -lglut -o binary_output_file

Okay, that's the way it is ;-)
Happy coding!