dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Turbo C++ graphics error

  1. #1
    Join Date
    Oct 2005
    Posts
    2

    Turbo C++ graphics error

    Hello there:

    What could I do to avoid this error using Turbo C++:

    *********************ERROR************************

    Graphics error: Device driver file not found (EGAVGA.BGI)

    ***************************************************

    THE PROGRAM I AM RUNNING IS THE FOLLOWING EXAMPLE FROM TCS HELP:

    ********************PROGRAM***********************

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

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

    /* initialize graphics mode */
    initgraph(&gdriver, &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 can I do to avoid this error message?.

    Thanks in advance,

    js

  2. #2
    Join Date
    Sep 2005
    Location
    New Delhi, India
    Posts
    332

    Re: Turbo C++ graphics error

    its basically a path problem...try doing this....
    Code:
    initgraph(&gdriver, &gmode, "\\tc\\bgi");
    *.bgi files are in this folder(default)...change the path if you have these file in some other folder

    and next time remember to use code tags
    Appreciate others by rating good posts

    "Only buy something that you'd be perfectly happy to hold if the market shut down for 10 years." - Warren Buffett

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)