SettingUpOpenGL

How to install and setup OpenGL on Linux
I tried following on Ubuntu12.04 and it works:

Install C++ compiler :
sudo apt-get install build-essential

harshv@ubuntu:~$ whereis g++

g++: /usr/bin/g++ /usr/bin/X11/g++ /usr/share/man/man1/g++.1.gz

harshv@ubuntu:~$ which g++

/usr/bin/g++

Installing OpenGL, FreeGLUT libraries:
sudo apt-get install freeglut3-dev

sudo apt-get install mesa-utils or sudo apt-get install libgl1-mesa-dev

sudo apt-get install binutils-gold

Check OpenGL version:
glxinfo | grep -i openGL

Compile first program:
g++ -lglut -lGLU -lGL test.cpp -o test