BGI Error:

This is a discussion on BGI Error: within the C Programming forums, part of the General Programming Boards category; hai everybody I tried to write a simple program which when compiled it will change the color of the Background ...

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    3

    BGI Error:

    hai everybody

    I tried to write a simple program which when compiled it will change the color of the Background to red and the code for that is
    Code:
    #include<conio.h>
    void main()
    {
    int gd=DETECT,gm;
    initgraph(&gd,&gm,"c:\\tctemp\\bgi");
    setbkcolor(4);
    getch();
    closegraph();
    }
    when i tried to compile its showing that
    BGI Error: Graphics not Initialized ( use 'initgraph' )

    when i checked no BGI named folder was there in c:\tctemp only but bgi.arc file was there what should i do to compile this program.

    Please help me

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,823
    Perhaps it means it's time to upgrade your compiler and graphics system to something which matches your OS and this millenium.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by it4_saravana View Post
    hai everybody

    I tried to write a simple program which when compiled it will change the color of the Background to red and the code for that is
    Code:
    #include<conio.h>
    void main()
    {
    int gd=DETECT,gm;
    initgraph(&gd,&gm,"c:\\tctemp\\bgi");
    setbkcolor(4);
    getch();
    closegraph();
    }
    when i tried to compile its showing that
    BGI Error: Graphics not Initialized ( use 'initgraph' )

    when i checked no BGI named folder was there in c:\tctemp only but bgi.arc file was there what should i do to compile this program.

    Please help me
    Normal install is to the C:\TC\BGI directory. Normal include is "graphics.h"

    Sounds like your install is not standard. Two ways to adjust it:

    1) If you have all the files, then go into Options >> Directories, and tell the compiler where to find the files it needs.

    2) If you don't have the files, or they aren't uncompressed, then go to Borland's archive web site. Frankly, I'd just d/l and install a new copy. Let it use the default directories for best results:

    TC -for the executables
    TC\BIN - for the IDE and your programs
    TC\BGI - for graphics drivers, etc.
    and so forth.

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    3
    can u please tel me the name of the website

  5. #5
    Registered User
    Join Date
    Mar 2008
    Posts
    3
    the problem is solved as the files are not uncompressed properly as i tried to instal once again and every thing was working fine

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 09:18 PM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 09:39 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21