kavya
kavya

Reputation: 9

BGI in computer graphics

bgi error graphics not initialised ('use initgraph')

This is the error I'm getting. Even after changing the BGI path and other solutions mentioned, I'm unable to overcome!

Upvotes: 0

Views: 890

Answers (2)

user15760427
user15760427

Reputation:

When we are using graphics in C we have to give the path of the folder where the bgi is saved on the device.

So when you are initialize the graph you need to pass the path of "bgi" as an argument.

Also, it is preferable to use Turbo-C for this purpose and most probably you will find the bgi file at following location:

C:\TurboC\BGI

initgraph(&gd , &gm ,"C:\\TurboC\\BGI");

Upvotes: 0

David Hoelzer
David Hoelzer

Reputation: 16331

The problem isn't that you are looking in the wrong directory, the problem is that the Borland Graphics Interface requires that you call initgraph() before you try to actually draw things. You would expect this to look something like this:

initgraph(&gd , &gm ,"C:\\TurboC\\BGI");

The suggestion in the comments, i.e., use a more modern graphics package, is also excellent advice.

Upvotes: 2

Related Questions