Running graphics.h code in Ubuntu | Process in description box
You need to install some basic packages. Open terminal and exicute the following commands on terminal.
1) sudo apt-get update
To update your basic packages
2) sudo apt-get install build-essential
For installing essential packages.
3) sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 guile-1.8-dev libart-2.0-dev libaudiofile-dev libesd0-dev libdirectfb-dev libdirectfb-extra libfreetype6-dev libxext-dev x11proto-xext-dev libfreetype6 libaa1 libaa1-dev libslang2-dev libasound2 libasound2-dev
For installing lib packages
4) Now, download libgraph from:
(http://download.savannah.gnu.org/releases/libgraph/libgraph-1.0.2.tar.gz). Then copy the file libgraph-1.0.2.tar.gz to our home folder. Right click on the file and select Extract here.
5) Open a terminal and run the following commands, one by one.
cd libgraph-1.0.2
./configure
sudo make
sudo make install
sudo cp /usr/local/lib/libgraph.* /usr/lib+
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 -lgraph (for C program)
g++ MyProg.cpp -lgraph (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.
ubuntu