Tuesday, 10 January 2017

How to Install OpenGL in Ubuntu

Prerequisite : Internet Connection

To install OpenGL on system you need to install some basic packages. Open terminal and execute the following commands on terminal.
Step 1: sudo apt-get update 
             To update your basic packages
Step 2: sudo apt-get install build-essential
              For installing essential packages.
Step 3: sudo apt-get install freeglut3 freeglut3-dev
Step 4: sudo apt-get install binutils-gold
Step 5: sudo apt-get install g++ cmake
Step 6: sudo apt-get install mesa-common-dev mesa-utils
Step 7: sudo apt-get install libglew-dev libglew1.5-dev libglm-dev
Step 8: glxinfo | grep OpenGL


Now you are ready to compile your program!
● Write your program using any editor and save.
● Open the terminal for the specified folder and then run with:
gcc MyProg.c -lGL -lGLU -lglut (for C program)
g++ MyProg.cpp -lGL -lGLU -lglut (for C++ program)
./a.out

● Once all this installation process is done, you don't need to follow this process again and again. Just
compile and execute the program.

2 comments:

  1. Thanks alot sir fot the help.
    Please upload all the programs of DSF,CG and PAI for IT if possible.

    ReplyDelete
    Replies
    1. Welcome sir shortly all programs will come

      Delete