banner



How To Install Graphics H In Fedora

How to add "graphics.h" C/C++ library to gcc compiler in Linux

While trying c graphic programming on Ubuntu, I figured out that graphic.h is non a standard C library and it is not supported past gcc compiler. So I am writing this article to explicate the process.
If you desire to utilize graphics.h on Ubuntu platform y'all need to compile and install libgraph. It is the implementation of turbo c graphics API on Linux using SDL.
You tin download it from hither libgraph
Step past Step Instructions:

  • Stride 1: Offset install build-essential past typing
sudo apt-go install build-essential
  • Pace 2: Install some additional packages by typing
sudo apt-get install libsdl-image1.two libsdl-image1.two-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
  • Stride 3: Now extract the downloaded libgraph-1.0.2.tar.gz file.
  • Pace 4: Goto extracted binder and run following command
./configure make sudo make install sudo cp /usr/local/lib/libgraph.* /usr/lib
  • Now you tin use graphics.h lib using following lines:
int gd = DETECT,gm;  initgraph (& gd,& gm,Cipher);

Instance lawmaking:

C

#include<stdio.h>

#include<stdlib.h>

#include<graphics.h>

int main()

{

int gd = Find, gm;

initgraph(&gd, &gm, NULL);

circumvolve(50, 50, 30);

delay(500000);

closegraph();

render 0;

}

Output:

output

Reference: enquire ubuntu
This article is contributed past Aakash Tiwari. If y'all like GeeksforGeeks and would like to contribute, y'all can as well write an article using write.geeksforgeeks.org or mail your article to review-team@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
Delight write comments if you find anything incorrect, or you desire to share more information about the topic discussed in a higher place.

Source: https://www.geeksforgeeks.org/add-graphics-h-c-library-gcc-compiler-linux/

Posted by: pinkstonsomight80.blogspot.com

0 Response to "How To Install Graphics H In Fedora"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel