- Related Questions & Answers
- Selected Reading
C++Server Side ProgrammingProgramming
All I can figure is that the instructions are for Linux, but I'm running Windows. I found a couple of instructions here on SO that tell me to copy certain files into the Dev-C folder, but I can't find the files specified. I've never had to install a library like this before, so I'm really lost.f.
- Nov 10, 2016 Dev-C is an integrated development environment (IDE) for the C programming language. It presents a feature-rich environment, tools for writing and debugging, as well as a compiler to provide you with all the tools necessary to program software in C.The program is a fork of the Bloodshed Dev-C environment, designed for advanced programmers looking to.
- Download The WinBGIm 6.0 (Nov 2005) source code. To build the library, use the provided makefile under the MSYS system, or use the provided Quincy2005 C/C IDE project file, WinBGIm libbgi.a.PRJ. The latest publicly available source code is.
C++ programming language is a versatile programming language. Using C++ you can create low end graphics too i.e. creating basic shapes and words with stylish fonts and adding colors to them can be done using c++.
Graphic programming can be done in c++ using your terminal or command prompt or you can download DevC++ compiler to create graphic programs.
For terminal you need to add the graphics.h libraray to you GCC compiler. For this you will have type in the following commands.
On sequentially typing all the above commands you can successfully install the graphics.h library in your GCC compiler of terminal.
for or the other method you need to install the DevC++ compiler.
graphics.h library − The graphic.h library is used to add graphics to your C++ program. For graphic programming, it is a must include library as it contains all required methods.
Syntax for including graphics in c++ program &ninus;
Syntax
![Graphics Graphics](/uploads/1/2/6/4/126468585/912977484.jpg)
Example
Program to show implementation of graphic programming in c++ −
Output
Other Common functions of of C++ graphic programming are −
- arc() − creates arc of a given angle and given radius.
- bar() − creates a bar with given coordinates.
- circle() − creates a circle of given radius.
- closegraph() − it closed the graphics mode and deallocated memory chunks.
- ellipse() − creates an ellipse with given major and minor axis.
- floodfill() − flood fill is used to fill a specific color to a specific point whose coordinates are given.
- line() − creates a line of given starting and ending points.
- rectangle() − creates a rectangle with given coordinates.
Download required libraries from here
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
Download Graphics Library For Dev C For Dev C++ Download
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
![Library Library](/uploads/1/2/6/4/126468585/892764792.jpg)
3. Include graphics.h and winbgim.h
Download Graphics Library For Dev C++
Copy and Paste the graphics.h and winbgim.h files into include folder of Code::Blocks directory.
Path: C:Program Files (x86)CodeBlocksMinGWinclude
4. Include libbgi.a
Copy and paste libbgi.a file in the lib folder of Code:Blocks
Path: C:Program Files (x86)CodeBlocksMinGWlib
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