Initgraph In Dev C%2b%2b


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. /parallels-desktop-120-2-41353-dmg.html.

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

Step by Step Instructions:

Initgraph In Dev C%2b%2b

Initgraph In Dev C 2b 2b 4

sudo apt-get install build-essential sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-2.0 guile-2.0-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.

  • A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
  • How To Use Initgraph In Dev C 4 graphics.h requires a specific library that is only found on Borland compilers (I don't think the newer Borland products even have it anymore). Look up WinBGIm as a possible alternative (however, it too is quite outdated).
  • Initializing C Graphics Mode: The computer display system must be initialized into graphics mode before calling the graphics function. The “initgraph” function is used to initialize the display into graphics mode. This function is a part of the “graphics.h” header file.
  • 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 command

    Now you can use graphics.h lib using following lines:

Example code:


// graphics in linux enviornment
#include<stdlib.h>
intmain()
intgd = 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 contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Important Notes (Added by a user) : Files from the above-given link did not work for me. There are somethings wrong with them I downloaded files from https://github.com/SagarGaniga/Graphics-Library
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

Initgraph In Dev C 2b 2b 1b

Recommended Posts:


Improved By : Ankur Parihar, amanbhawsar99, VIPULKRISHNAMATHURIA

Initgraph In Dev C 2b 2b 1