How do I use graphics.h in Ubuntu?

Опубликовано: 01 Июль 2026
на канале: Ubuntu Tricks
9,460
61

How do I use graphics.h in Ubuntu?


steps:


step 1:
Make sure that you have basic compilers installed.
For this run the command:

"sudo apt-get install build-essential"


step 2 :
Install few packages that required.
Run the command:


"sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 guile-1.8-dev libsdl1.2debian 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"

step 3:

Now download libgraph. Download link given below in description.

download.savannah.gnu.org/releases/libgraph/libgraph-1.0.2.tar.gz

step 4:

Extract it into home directory. After run this commands:

"cd libgraph-1.0.2"
"./configure"
"sudo make"
"sudo make install"
"sudo cp /usr/local/lib/libgraph.* /usr/lib"



step 5:
Now Ubuntu is ready to run graphics program.
To do that add graphics.h header file in your C or C++ program.