problem with graphics.h

muqaffa97
muqaffa97 used Ask the Experts™
on
I try to make a graph and compile a line of :

#include <graphics.h>
main(){
 int gdriver = DETECT;
 int gmode;
 initgraph(&gdriver,&gmode,"");
 // a line command : make a line, outtextxy, etc
 closegraph();
}

but there is a message informed that compile process was fault :
"graphics.h(20,52):error directive:bgi graphics not supported under  
 windows."

please help me
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
You are trying to use old DOS graphics library from Borland under Win32.

That simply won't work, try to use an old MS-DOS compiler such as Turbo C++ or some such.

Another possibility is to rewrite your code to use windows graphics but that will involve much rewriting. However, you do have the code in more modern fashion once you've done that.

Hope this is of help.

Alf
You should definetly try this:

http://www.cs.colorado.edu/~main/bgi/doc/bgi.html
 

it worked great for me.

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered: Points to e12voltsdac

Please leave any comments here within the next seven days. Experts: Silence
means you don't care.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

-bcl (bcladd)
EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial