Tuesday, July 28, 2009

TURBO C problem?

Device driver file not found (EGAVGA.BGI)





This message is coming in the output when I am trying to run this program of graphics which is absolutly correct.


#include %26lt;graphics.h%26gt;


#include %26lt;stdlib.h%26gt;


#include %26lt;stdio.h%26gt;


#include %26lt;conio.h%26gt;


int main(void)


{


/* request auto detection */


int gdriver = DETECT, gmode, errorcode;


/* initialize graphics mode */


initgraph(%26amp;gdriver, %26amp;gmode, "");


/* read result of initialization */


errorcode = graphresult();


if (errorcode != grOk) /* an error occurred */


{


printf("Graphics error: %s\n", grapherrormsg(errorcode));


printf("Press any key to halt:");


getch();


exit(1); /* return with error code */


}


/* draw a line */


line(0, 0, getmaxx(), getmaxy());


/* clean up */


getch();


closegraph();


return 0;


}





what to do to get this file back?

TURBO C problem?
The system is being unable to detect the driver file automatically.


Make sure that EGAVGA.BGI file is present in the current directory in which your source code is present.


If it did not helped find the correct path of the driver file , and modify the line: int gdriver = DETECT; to int gdriver = "%26lt;path%26gt;";


Then compile your program.
Reply:Just go online type the program name on google n ull get it bak if it dosent work get a book of C programming (a good 1)


ull find da progam fr sure
Reply:Hey if your programme is not detecting bgi file automatically then you can initialize your graphic driver using this statement.





initgraph(%26amp;gdriver,%26amp;gmode,"..\\bgi");
Reply:After Open the file go to File menu%26gt;Change Dir%26gt;select BGI folder.


for example if your TC installed in c:\tc the default path is: c:\tc\bin. simply change it to c:\tc\bgi


No comments:

Post a Comment