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

BGI Error:- Graphics not Initialized(Use Initgraph)

Hi all,

I have already used InitGraph and have given the path(C:\\TC\BGI) in Initgraph and checked the Graphics option in Linker Options. Still Iam getting this error. I want a solution. Can somebody pls help me. Its urgent.

pvbhargav
Newbie Poster
2 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

A wild stab in the dark suggests that you need to double up the second \ in your pathname, so

C:\\TC\\BGI

But since you've only paraphrased the problem, who knows whether that typo exists in your actual code, or whether there is some other problem you haven't bothered to mention. Post actual code if you want a fast accurate response.


> Can somebody pls help me.
http://www.catb.org/~esr/faqs/smart-questions.html#prune
http://www.catb.org/~esr/faqs/smart-questions.html#writewell

> Its urgent.
http://www.catb.org/~esr/faqs/smart-questions.html#urgent

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

of course the BGI is 20+ year old technology first developed for DOS 3 and never meant for use under Windows so it's quite possible even if you called the method that it failed and you didn't properly handle that failure.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Hi all,

The option is working in my office while it is not working in my home system. Pls help me fix this problem.

Thanks

pvbhargav
Newbie Poster
2 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

Go to c:\tc and make sure there is a folder named "BGI" and that the drivers are in it.

Colin Mac
Posting Whiz
327 posts since Sep 2006
Reputation Points: 78
Solved Threads: 22
 

Well , Using the same ancient Turbo C++ 3.0 in school, i ran into the same problem. The two lines of graphics above should be :
Assuming that you installed Turbo C to C:\TC

int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");

Obviously include the graphics.h.
If it still doesnt work , Press CTRL-F , then D.
(Dos Shell from the Compiler File Menu).
Write :

C:\TC\BGI
exit

It should work now. If it still doesnt work , im pretty sure that its a corrupted installation or you are missing the *.BGI Files.
Also , I think you'd have done this , but dont forget to enable the Graphics Libraries in Options > Linker > Libraries.

ashmew2
Newbie Poster
3 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

You are required to check whether the compiler is installed in c drive or not
if it is installed in other drive u must specify the program as
for eg. it is installed in d drive

d:\\tc\\bgi

and also change the path in the compilers directory

ajay.krish123
Junior Poster in Training
90 posts since Nov 2008
Reputation Points: 6
Solved Threads: 9
 

thanks guys mah first day on this website and i got the answer for mah question.....the same of bgi error

goldy007
Newbie Poster
1 post since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

just copy the file egavga.bgi from your /bgi folder and paste it in your /bin folder.
You should'nt be getting the error any more.

avi4ash
Newbie Poster
1 post since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

Thank u guys....me too got d same error nd resolved it :)

indrapriya
Newbie Poster
2 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

Dear Indrapriya,

Please mark the problem as solved.

hinduengg
Junior Poster in Training
88 posts since Jun 2007
Reputation Points: 36
Solved Threads: 4
 

hi all i am using windows 7 ultimate and i got this same error when i run my pgm also i got linker error like you...bt i solved this prbl by using DOSBOX 0.74..now my pgm is running smoothly..i have followed these steps
1.download dosbox 0.74
2.create a folder say "Turbo" in c:\
3.download turboc for window 7 ultimate 32 bit
4.extract zip file into "Turbo"
5.from START->Dosbox->options->dosbox options->(you can see a word documnet open it)->@ the end of document add the following steps
mount d c:\Turbo\
d:
cd tc
cd bin
tc
then save
6.then go to c window(c:\turbo\tc\bin\tc.exe)->directories->type D:\TC\INCLUDE
and D:\TC\LIB
7.also in Linker->Libraries->enable Graphics library
8.also put a line in main()
initgraph(&gd,&gm,"d;\\tc\\bgi");
Best of luck..........:)

shahana.1988
Newbie Poster
2 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

initgraph(&gd, &gm, "C:\\TC\\BGI");
What does the "\\" in the path specified in initgraph signify?

ironmancpp
Newbie Poster
22 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

The path to the BGI drivers.

Adak
Nearly a Posting Virtuoso
1,479 posts since Jun 2008
Reputation Points: 425
Solved Threads: 185
 

I meant what does the usage of \\ instead of \ mean? What is its significance?

ironmancpp
Newbie Poster
22 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

The backslash char is an escape char in C. It's paired up with another char to represent something difficult to type: like \n for a newline char, or \t for a tab, etc.

Two backslashes is used when you want to delineate just one backslash itself.

Adak
Nearly a Posting Virtuoso
1,479 posts since Jun 2008
Reputation Points: 425
Solved Threads: 185
 

...

INDIAN_007
Newbie Poster
2 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

hello frnds ........on Window 7 error occur or not output show of graphics.h program..........for this i have simple one solution.....
go to end link and check .....and forward this for other .because i understand this that i have face............so help others .......not forget to say thanx.....
email-toohaapy@rocketmail.com


link--> http://www.uniqueness-template.com/devcpp/

read carefully all steps.......

INDIAN_007
Newbie Poster
2 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

thanks i resolved my error

JackieJes
Newbie Poster
1 post since Feb 2011
Reputation Points: 10
Solved Threads: 0
 
stylsh
Newbie Poster
1 post since Apr 2011
Reputation Points: 7
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You