Board index » delphi » egavga.bgi error using borland c++ 3.1 for dos

egavga.bgi error using borland c++ 3.1 for dos

While attempting to run the following code (which is supposed to display a
line on the screen and was lifted directly from the compiler's help files) I
always get an error message which says 'cannot find egavga.bgi'. I found
this file in the c:\borlandc\bgi folder but I have no idea how to get the
compiler to acknowledge it's existance. Could somebody please tell me how
this might be done (even if you can only come up with a wild guess, I have
no idea what to do)?

here is the code (I'm running dos prompt under win98:

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int xmax, ymax;

/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");

/* read result of initialization */
errorcode = graphresult();
/* an error occurred */
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);

Quote
}

setcolor(getmaxcolor());
xmax = getmaxx();
ymax = getmaxy();

/* draw a diagonal line */
line(0, 0, xmax, ymax);

/* clean up */
getch();
closegraph();
return 0;

Quote
}

p.s:  is this an okay post for this newsgroup?  I keep getting flamed for posting c++ questions in c++ groups.
 

Re:egavga.bgi error using borland c++ 3.1 for dos


"matthew.green5" <matthew.gre...@ntlworld.com> wrote in
news:xq5X7.51443$US4.9094583@news2-win.server.ntlworld.com:

Quote
> While attempting to run the following code (which is supposed to
> display a line on the screen and was lifted directly from the
> compiler's help files) I always get an error message which says 'cannot
> find egavga.bgi'. I found this file in the c:\borlandc\bgi folder but I
> have no idea how to get the compiler to acknowledge it's existance.

You can copy the missing file in the current directory.

(Long time ago, I used the 'append' MS-DOS command, but it seems that it
doesn't work any more under Windows)

Possibly there could also be an environment variable to fill-in with the
required path. I'm not sure...

--
-ed- emdel at noos.fr
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-library: http://www.dinkumware.com/htm_cl/index.html
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/

Other Threads