We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,322 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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:'(

7
Contributors
6
Replies
1 Year
Discussion Span
8 Months Ago
Last Updated
37
Views
logicslab
Newbie Poster
11 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

WaltP
Posting Sage w/ dash of thyme
Team Colleague
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37

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
Skill Endorsements: 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
Achieved Level 70
Team Colleague
32,145 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,577
Skill Endorsements: 69

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: 20
Skill Endorsements: 0

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
Skill Endorsements: 0

thnx so much!
it works!

gamemeon
Newbie Poster
1 post since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0730 seconds using 2.71MB