BGI error, How to Resolve it?

后端 未结 6 1774
独厮守ぢ
独厮守ぢ 2021-01-13 18:02

I want to run a C program that draws a circle. The program is compiling with no error and it is running. After getting the values like radius from the user, I get the error

相关标签:
6条回答
  • 2021-01-13 18:26

    Your path in initgraph is wrong. Use "c:\\tc\bgi" instead.

    0 讨论(0)
  • 2021-01-13 18:29

    If you get this error message when you run your graphics program: BGI Error: Graphics not initialized (use 'initgraph')

    Just you need to copy the \tc\bgi\EGAVGA.BGI file to your local folder where you are running the application.

    0 讨论(0)
  • 2021-01-13 18:34

    I also suffered from that problem.

    Simply put this line:

    initgraph(&gdrive,&gmode, "c:\tc\bgi"); 
    

    here c:\tc\bgi is important.

    MOST IMPORTANT:

    In tc.exe (which you are using) at top are some menus like file, edit, options:

    • Go options>application
    • select overlay (By Default it is "standard" but you must select "overlay" option), then click on ok.
    • now you run your graphics progaram.

    NOTE: in the output, if it gives an error about bgi, ignore it, just give the input for the program if it is required and it will give you the graphics output. Enjoy.

    0 讨论(0)
  • 2021-01-13 18:35

    if by including "C:\tc\bgi" still the error persists , try this: goto file-> change directory.. change it to bgi.. but this has to be done every time u open the turboc

    0 讨论(0)
  • 2021-01-13 18:36

    Could be multiple reasons:

    • wrong path to the bgi file (I see the colon is missing)
    • unsupported graphics mode (don't expect DOS graphics apps to work under Vista and up)
    0 讨论(0)
  • 2021-01-13 18:45

    Try this (it worked for me) :

    The BGI folder is usually in the following path,

    C:\TurboC++\disk\TurboC3\BGI

    So the code you need to put in your program is as follows,

    initgraph(&gd, &gm, "C:\\TurboC3\\BGI");
    
    0 讨论(0)
提交回复
热议问题