Bgi Error: Graphics not initialized (use initgraph) Bgi Error: Graphics not initialized (use initgraph)

Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4

Thread: Bgi Error: Graphics not initialized (use initgraph)

  1. #1
    Right off the assembly line Reputation
    Join Date
    Mar 2005
    Post Thanks / Like

    General Bgi Error: Graphics not initialized (use initgraph)

    I have made a program in c++. My program is running fine, but at the
    end of the program there is a error message on the screen:

    Bgi Error: Graphics not initialized (use initgraph)

    My program shows no error message at compile time or at run time.
    What's this bgi error? How can I correct this? I have initialized the graphics hardware by using the initgraph function on the main segment
    of my program. I am using Borland Turbo c++ compiler 3.1.

  2. #2
    Human Spambot Reputation
    Join Date
    May 2004
    off to "never ever" land
    Post Thanks / Like


    For some reason initgraph() failed. To find out why, check
    the return value of graphresult(). For example:
    int main(void)
        int gerr;   /* graphics error */
        int gdriver = DETECT, gmode;
        /* Initialize graphics using auto-detection and look
        for the .BGI and .CHR files in the C:\TURBOC directory.
        initgraph(&gdriver, &gmode, "C:\\TURBOC");
        if ((gerr = graphresult()) != grOk)
            printf("Error : %s\n", grapherrormsg(gerr));
    No Mercy, No Limits. - Keeping Knowledge Free

  3. #3
    In The Zone Reputation
    Join Date
    Mar 2005
    Right behind you...
    Post Thanks / Like


    bgi error usually occur when valid graphics driver are not loaded.
    using initgraph only not solve this problem, you have to give proper path for bgi graphics drivers which are usually find in bgi folder
    use this
    where gd=GRAPHICS DRIVER
    ""=path where driver reside

  4. #4
    Right Off the Assembly Line Reputation
    Join Date
    Mar 2005
    Post Thanks / Like

    General bgi error

    hey bgi means borland graphics interface.
    i think u include graphics.h without writting code for graphics mode
    here is the code:
    void main()
    int d=DETECT,m;
    initgraph(&d,&m,"c:\tc\bgi");//or mentioned the path of ur turbo c3
    printf("%d",d);//this will display which driver u have (u can check it in graphics.h)
    printf("%d",m);//which mode resolution
    try it in c extention.....
    njoy c man

Similar Threads

  1. Intel HD Graphics with Dedicated Graphics Card
    By RBX in forum Hardware Q&A
    Replies: 5
    Last Post: 02-08-2011, 03:16 AM
  2. Replies: 1
    Last Post: 19-06-2008, 12:39 AM
  3. Replies: 17
    Last Post: 04-08-2007, 02:47 PM
  4. Replies: 1
    Last Post: 10-07-2006, 03:28 AM
  5. Error error me hell of a terror
    By abhilash in forum QnA (read only)
    Replies: 4
    Last Post: 06-11-2004, 12:41 AM

Tags for this Thread


Posting Permissions

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