Graphics.h runtime error

Despite having entered the library "graphics.h" in the folder "include" and the file "libbgi.a" in the "lib" folder and having linked the linker nell'immagie following the various instructions, the compiler gives me an error at runtime ...

IMAGE -> http://i59.tinypic.com/nb6hci.jpg

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <graphics.h>

int main()
{
   int gd = DETECT, gm;
   int x = 320, y = 240, radius;

   initgraph(&gd, &gm, (char*)"C:\\TC\\BGI");

   for ( radius = 25; radius <= 125 ; radius = radius + 20)
      circle(x, y, radius);

   getch();
   closegraph();
   return 0;
}
It is because the BGI graphics expect powers that modern systems don't give out willy-nilly anymore.

To use the old <graphics.h> library, your options are:

(1) Run your program in DosBox, and x86 emulator
http://www.dosbox.com/

(2) Get a modern compiler (MinGW) and use WinBGIm
http://winbgim.codecutter.org/

The first solution is far easier.

The only other options are to get a modern compiler and use a modern graphics library, like Allegro.

Sorry.
Topic archived. No new replies allowed.