Executing the OpenGL Programs in Windows is quite easy as compare executing it with the Linux OS. You just need to install the Visual studio in windows machine and paste the right file in proper folder. But in Linux (Ubuntu) that not as easy, this is thought of many students.While this wrong assumption, Linux may be little hard to execute as it need more a programmatic approach rather than a simple use of GUI. There are many of students feel difficult to install the OpenGL/Glut libraries in Ubuntu or any Linux. Here we are going to learn how to install the OpenGL/Glut libraries in your Desktop or PC to execute the OpenGL Programs in C/C++ Computer graphics.
How to Install OpenGL/Glut libraries in Ubuntu/Linux
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):
System will automatically install the necessary files which you need to run the OpenGL programs in Ubuntu.
sudo apt-get install binutils-gold
Note: If you are not administrator then, you need to ask for sudo permission.
Note: we are running any openGL code using simple command
4. Now create any c file(for example test.c) and compile :
gcc -lGL -lglut test.c -o test
5. Run the program :
Use the following command and create the file, as done with usual C/C++ program in Linux.
Use the following command and create the file, as done with usual C/C++ program in Linux.
./test
gcc -lGL -lglut test.c
than run using this command
./a.out
No comments:
Post a Comment