While trying c graphic programming on Ubuntu, I figured out that graphic.h is not a standard C library and it is not supported by gcc compiler. So I am writing this article to explain the process.
C Graphics Functions
If you want to use graphics.h on Ubuntu platform you need to compile and install libgraph. It is the implementation of turbo c graphics API on Linux using SDL.
You can download it from here libgraph
You can download it from here libgraph
In order to run graphics programs under Dev-C++ you have to download WinBGIm files. Download the files listed below. Graphics.h (download to C: Dev-Cpp include) libbgi.a(download to C: Dev-Cpp lib) Once you download the files. Now you have to place into the correct location in Dev-C++ installation folder. How to add “graphics.h” C/C++ library to gcc compiler in Linux. If you want to use graphics.h on Ubuntu platform you need to compile and install libgraph. It is the implementation of turbo c graphics API on Linux using SDL. Now extract the downloaded libgraph-1.0.2.tar.gz file.
Step by Step Instructions:
- STEP 1: First install build-essential by typing
- STEP 2: Install some additional packages by typing
- STEP 3: Now extract the downloaded libgraph-1.0.2.tar.gz file.
- STEP 4: Goto extracted folder and run following commandNow you can use graphics.h lib using following lines:
Example code:
// graphics in linux enviornment #include<stdlib.h> int main() int gd = DETECT, gm; closegraph(); } |
Output:
Reference: ask ubuntu
This article is contributed by Aakash Tiwari. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to [email protected]. See your article appearing on the GeeksforGeeks main page and help other Geeks.
This article is contributed by Aakash Tiwari. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to [email protected]. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Graphics.h File For Eclipse Mingw
![Graphics.h File For C Graphics.h File For C](/uploads/1/2/6/4/126479693/821340759.jpg)
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.