Whenever you #include <graphics.h> in a program, you must
instruct the linker to link in certain libraries. The command to do
so from Dev-C++ is Alt-P. Choose the Parameters tab from the pop-up
window and type the following into the Linker area:
-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32
You can now compile and run programs that use the WinBGIm graphics
library, such as this one that opens a small window, draws a circle
and waits for the user to press a key:
#include <graphics.h>
int main( )
{
initwindow(400, 300, "First Sample");
circle(100, 50, 40);
while (!kbhit( ))
{
delay(200);
}
return 0;
}
Michael Main (main@colorado.edu)