954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to configure graphics.h in Dev-C++

Hi pals,
I am a Newbie in C++ Programming field. I plan to add graphics.h header class in
Dev -C++ Version 4.9.9.2 from Bloodshed which is come along with Borland Compiler.
I follow the Steps in URL : http://www.uniqueness-template.com/devcpp/#step2

But I Got Error in the Sample code which test the Working , Please Help me
to get away from this problem . I am waiting to hear from you.

Regards
Anes P.A:'(

logicslab
Newbie Poster
11 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

You can't. graphics.h is not compatible with Dev-C++

WaltP
Posting Sage w/ dash of thyme
Moderator
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

I can do graphics in Dev- C++. I am using Dev-C++. :).
Just follow the instructions carefully and do not forget to put linkers. You can't do a graphics by making a new source file. You need to do a new project to put linkers.

glenn_boy13
Newbie Poster
4 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 
I can do graphics in Dev- C++. I am using Dev-C++. :). Just follow the instructions carefully and do not forget to put linkers. You can't do a graphics by making a new source file. You need to do a new project to put linkers.

Yes, but you are not using the 16-bit functions that are in graphics.h that is supplied with Turbo C. I vaguely recall something that someone made a port of graphics.h for 32-bit MS-Windows compilers.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Why would you want to use graphics.h anyway? It was written for dos, and almost no one runs dos now.

chrjs
Junior Poster in Training
96 posts since Feb 2011
Reputation Points: 58
Solved Threads: 19
 

Hey LogicsLab,
You can easily solve this problem, DEV-C++ do support graphics.h with a 24-bit color mode, Ive developed many apps using that,
first : Download "graphics.h" and "libbgi.a" from :
http://www.cs.colorado.edu/~main/bgi/dev-c++/
Second:
Make a new console Application from File->New->Project
Third:
Copy both the downloaded files into the location where u've made the project
e.g c:\DEV-CPP>

Fourth:
Goto Project->Project Options-> Parameters and copy paste this in linker tab:
-L.
-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32

Fifth:
add this line in the start of your main.cpp:
#include "graphics.h"

Sixth :
write this to main()

initwindow(800,600);


Now you can use any drawing function!
you can get them from: http://www.cs.colorado.edu/~main/bgi/doc/
Enjoy!

sdeez_alpha
Newbie Poster
5 posts since May 2010
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: