Pages

Saturday, 11 May 2013

How to Install OpenGL/Glut libraries in Ubuntu/Linux/Windows

Download OpenGL/Glut in Ubuntu/Linux:


1. The first step is to open terminal using CTRL+ALT+t command.

2. Now install the development libraries of OpenGL/Glut in Ubuntu(paste the below command on terminal):

sudo apt-get install freeglut3 freeglut3-dev

3. For newer versions of Ubuntu (>= 11.10) you have to install another package because the linker does not link anymore(paste the below command on terminal):

sudo apt-get install binutils-gold

4. Now create any c file(for example test.c) and compile :

gcc -lGL -lglut test.c -o test
 
5. Run the program

./test

Note: If we are running any openGL code using simple command

gcc -lGL -lglut test.c

than run using this command

./a.out 

Download OpenGL/Glut in Window XP/7/8:


1. Download and install Visual C++ Express from http://www.microsoft.com/express/Downloads/ 

2. Download and extract "freeglut 2.8.0 MSVC Package" from http://www.transmissionzero.co.uk/software/freeglut-devel/ 

3. Installation for Windows 32 bit:

(a) Copy all files from include/GL folder and paste into C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\gl folder.

(b) Copy all files from lib folder and paste into C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib folder.

(c) Copy freeglut.dll and paste into C:\windows\system32 folder.

4. Installation for Windows 64 bit:

(a) Copy all files from include/GL folder and paste into  C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0A\Include\gl folder.

(b) Copy all files from lib folder and paste into C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0A\Lib folder.

(c) Copy freeglut.dll and paste into C:\windows\SysWOW64

5. Now create any empty project as win 32 console application.

6. Right click on project -> click on properties -> change configuration to All configuration and select linker -> input -> add ;freeglut.lib at the end of Additional Dependencies on right pane.

How to Install OpenGL/Glut libraries in Ubuntu/Linux/Windows

7. Copy one of the OpenGL program from this blog and paste into main file and click on run(run command CTRL+F5).

Note: All programs of OpenGL on this blog are checked on Visual C++ 2010 software(Window XP).

Related Programs:-

Zoom in and Zoom out Triangle using key

Self rotating Triangle

Rotate Triangle using Key

Draw text on the Screen

Sun Rise and Down

1 comment:

  1. This comment has been removed by the author.

    ReplyDelete

Back to Top