DIGIT-ARC read-only archive · snapshot: July 23, 2026

C graphics wont work on my pc

6 posts · originally from https://geek.digit.in/community/threads/c-graphics-wont-work-on-my-pc.126264/

S
srishet Original post #1
Apr 29, 2010 at 11:47 AM
Hello

I have an issue C graphic programming. I have simple circle drawing program. You can view the program code at: *testsrikanth.ipower.com/CIRCLES.txt . I m using Borland C 3.0 version. When I compile it doesn't have any errors. However, When I Run the program, it show blank window and close automatically. Please help me how to run graphics in C program. I am using Atom processor.

Thanks
Srikanth Shet
A
Apr 30, 2010 at 10:38 AM
which operating system are you using ?
if its newer than windows xp .. I am afraid you won't be able to run the code.
but if you are using xp ...
the problem could / should be in the path specified in initgraph(&gd, &gm,"")
the thing under quotes is supposed to be
"c:\\tc\\bgi" if your bgi (borland graphics) files are in this directory.

P.S change the path accordingly. It should work.

hope this helps
S
srishet #3
Apr 30, 2010 at 12:28 PM
I am using Windows XP SP3 Operating System. Could you please tell me how to change the path. I m using Boraland C and it is installed on D:\ drive. However, I have changed the directories of Library, output, include in the Option Menu of C program.
A
May 1, 2010 at 12:17 AM
xp .. every thing should work fine.
borland C 3.0 .. isn't it called Turbo C++ 3.0?
anyways .. for making things work, as I have already told you. you just need to change the third parameter of the initgraph function. This is what your function should look like:

Code:
initgraph(&gdrive,&gmode,"d:\\tc\\bgi");

the job of the third parameter is to indicate the location of borland graphics interface (bgi) files, mainly egavga.bgi (the driver)

if you don't want to make this change you may also copy the files present in \\bgi folder to the output folder .. (probably the \\bin folder)

this should make it work
S
srishet #5
May 1, 2010 at 10:00 AM
Thank you very much sir. I really appreciated. It works. I just copied the file egavga.bgi to Bin Folder. Once again thank you sir.
A
May 1, 2010 at 7:09 PM
if in future you would like to incorporate graphical fonts in your 16 bit program .. then copy the font file too to the output directory.

and you're welcome ... anytime