User forums > Using Code::Blocks

need to run simple graphic program

(1/1)

r0x:
Hi there! How should I run this code? Which type of project do I need? Thanx!

/* Sample program to draw a circle*/
#include<graphics.h>
#include<conio.h>
main()
{
  int gd=DETECT,gm;
  initgraph(&gd,&gm,""); /* initialization of graphic mode */
  circle(150,150,100);
  getch();
  closegraph(); /* Restore orignal screen mode */
}
/* End of program */

ollydbg:
Where did you copy these code snippet?
It seems it is for old BGI library of "Turbo C 2.0 " or "Borland C++" compiler. (It's an old compiler in the last centry :D)

So, I suggest you can
1, learn to use a new graphics library, like wxWidgets or others...
2, learn to use a BGI library for MINGW, see WinBGIm - Borland BGI emulation for MingW

Good luck!!!

Navigation

[0] Message Index

Go to full version