How to run C/C++ graphics programs on Ubuntu
In Ubuntu, we need to install libgraph library that contains graphics.h header file and other important files to be able to run any graphics program . libgraph is an implementation of the TurboC graphics API (graphics.h) on GNU/Linux using SDL.
Follow these steps to install libgraph on ubuntu:
Follow these steps to install libgraph on ubuntu:
- Open terminal. (ctrl + shift + T). Copy paste the following command. It will download and update the packages in your system. (it requires Internet connection).
sudo apt-get update
- After that execute the following command to install SDL(Simple DirectMedia Layer) packages.
sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 guile-1.8-dev
- Now, download libgraph package from here
- Extract that file and open the extracted folder and right click on empty space and click open in terminal.In terminal execute following commands one by one:
. /configure
sudo make install
sudo cp /usr/local/lib/libgraph.* /usr/lib - You have successfully installed libgraph package.
You can compile a graphics program by typing following commands:
For C++ programg++ <program_name>.cpp – lgraph
For C program:gcc <program_name>.c – lgraph
- To run the program, use following command
./a.out
[…] Learn how to run C/C++ graphics programs on Ubuntu here […]
ReplyDelete[…] Learn how to run C/C++ graphics programs on Ubuntu here […]
ReplyDelete[…] Learn how to run C/C++ graphics programs on Ubuntu here […]
ReplyDelete[…] Learn how to run C/C++ graphics programs on Ubuntu here […]
ReplyDelete