How to add graphics.h in Devc++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to add graphics.h in Devc++

I refrenced through many videos but didnot find anyone helpful .I am using Windows 10 and Dev c++ 5.11

27th Jan 2018, 4:18 PM
Mohd Zaki
Mohd Zaki - avatar
2 Answers
+ 5
@kurwius there's a (fan-made?) version of BGI graphics that works on windows. It even has mouse and keyboard support. I tested it out of curiosity about a year ago in MinGW Studio and CodeBlocks, on windows 7. The instructions were on the site where I downloaded it, you had to put the .h files in the include folder of MinGW, the .a file in the lib folder, link the lib with your project... the usual stuff when using a library. I'm on the phone, about to fall asleep now, but maybe this is a starting point for someone willing to help. If not, maybe I'll return in the morning with a more useful answer.
27th Jan 2018, 11:41 PM
lion
lion - avatar
+ 2
Download from http://winbgim.codecutter.org/ Copy graphics.h and winbgim.h to the include directory of DevCpp\MinGW32, libbgi.a to the lib directory, and in your project press Alt-P, choose the Parameters tab and copy the following into the Linker area: -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 I just tested it with DevCpp 5.2.0.1 on win 7. Although kurwius is probably right (I bookmarked that link), I can't deny the simplicity of this lib. I made a rudimentary drawing program with saving capability in less than 20 lines. I found a mistake in graphics.h though: at line 302, in function printImage() some parameters are left, right, right <- see, redefinition. They should be left, top, right. (I also happen have an older version of the lib and that one didn't have the mistake, was smaller and only needed -lbgi to the linker; but i can't find it anywhere for download anymore; oh well)
28th Jan 2018, 12:50 PM
lion
lion - avatar