Dev C++ Graphics Header File

Download required libraries from here

  • I have been searching to get the source code of the header file graphics.h and its associated library in order to integrate it with my C program. At the same time, I am interested in those cross-platform libraries that works on more than one compiler.
  • Apr 08, 2015  I have used graphics.h in dev cpp. Though I can't remember the exact steps I used to include it, but I think the below answer is correct. Source: How to configure graphics.h in Dev-C You can easily solve this problem, DEV-C do support gra.

The C library function void exit(int status) terminates the calling process immediately. Any open file descriptors belonging to the process are closed and any children of the process are inherited by process 1, init, and the process parent is sent a SIGCHLD signal. This function does not return any.

It is a tradition to use Turbo C for graphic in C/CPP. But it's also a pain in the neck. Here we are using Code::Blocks IDE, which will ease out our work.

Steps to run graphic code in CodeBlocks

1. Install Code::Blocks

Make sure you have installed Code::Blocks IDE on your machine. If you don't have this IDE or have any issue with compiler download and install it from here. http://sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/codeblocks-16.01mingw-setup.exe

2. Download the required header files

We need few files to be included in the lib folder of Code::Blocks.Download the files from here https://github.com/SagarGaniga/Graphics-Library

3. Include graphics.h and winbgim.h

Copy and Paste the graphics.h and winbgim.h files into include folder of Code::Blocks directory.

Path: C:Program Files (x86)CodeBlocksMinGWinclude

Code

4. Include libbgi.a

Copy and paste libbgi.a file in the lib folder of Code:Blocks

Path: C:Program Files (x86)CodeBlocksMinGWlib

Dev C++ Graphics Header Files

5. Add Link Libraries in Linker Setting

  • In the Code::Blocks application go to, Settings > Compiler

  • In the Global Compiler setting, click on the Linker Settings

  • In Link Libraries, Add and browse to C:Program Files (x86)CodeBlocksMinGWlib and select libbgi.a.

  • Paste this in the Other Linker Option tab of Linker Settings (i.e. on the right-hand side)

    -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32

  • Save the setting and restart the application

Dev C++ Graphics.h

To test the setting copy paste any computer graphics code from