●This project is not part of the GNU Project. libgraph is an implementation of the TurboC graphics API (graphics.h) on GNU/Linux using SDL. The library requires SDL for primitive graphics and SDL_image (to blit fonts). Functions for text display are based heavily on code "borrowed" from Karl Bartel's SFont library.
● The library is not very powerful or flexible. It is probably not suitable for use in production-quality applications. I see it more as a simple, easy-to-use 2D graphics interface - could be used for simple prototyping, visualization or studying graphics algorithms. It is simplified library to run graphics programs in C.
It works efficiently with open source C compiler gcc. It is required to add the sdl-libgraph library to current existing gcc
Prerequisite: Internet Connection
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.
very super
ReplyDeletethank you soo much..!!
ReplyDeleteit really worked..
only in the last step ofinstallation (sudo cp /usr/local/lib/libgraph.*/usr/lib) should be there
the '+' sign after that should not be there..
otherwise it is cool
kindly share information about UBUNTU version you are using
Deletethank you bro
Deletethank you..!!
ReplyDeleteyou are welcome
ReplyDeleteHello, when I take the second step I can not follow someone I could help?
ReplyDeletecp: target '/usr/lib+' is not a directory
ReplyDeletegetting this error
i got make command not found error
ReplyDeletewhen I type in commands for third step, the terminal shows error could not find package guile-1.8-dev. Please can you help me out with this?
ReplyDeleteI get the guile file error too. anyone have an idea?
ReplyDeleteuse this command as step 3 for new libgraph
ReplyDeletesudo apt install libsdl-image1.2 libsdl-image1.2-dev guile-2.0 guile-2.0-dev libsdl1.2debian libart-2.0-dev libaudiofile-dev pulseaudio-esound-compat libdirectfb-dev libdirectfb-extra libfreetype6-dev libxext-dev x11proto-xext-dev libfreetype6 libaa1 libaa1-dev libslang2-dev libasound2 libasound2-dev