How to use the winbgim library for the free mingw32 gnu C++ compiler
Download and install the free cs1300 tools, as described in www.cs.colorado.edu/~main/cs1300/README.html.
The header file: Change to the cs1300\include subdirectory and check whether you have the file winbgim.h. If not, then download this file into that directory by holding down the left-shift key and clicking on this link: http://www.cs.colorado.edu/~main/bgi/winbgim.h.
The archieved library file: Change to the cs1300\lib subdirectory and check whether you have the file libbgi.a. If not, then download this file into that directory by holding down the left-shift key and clicking on this link: http://www.cs.colorado.edu/~main/bgi/libbgi.a.
Write your program as you normally would, using the BGI graphics functions. Instead of including graphics.h, you should have this statement:
#include <winbgim.h>
In order to actually process graphics events, the program should regularly call kbhit, getch, or delay (which are described below). Otherwise the graphics events may end up in a buffer that doesn't get processed. You may also call some new functions for mouse control and full RGB color, as described below.
When you create an executable (exe) program that uses the winbgim library, you must add the three options -lbgi -lgdi32 -luser32 (in that order) after any other file arguments to the compiler. For example, to compile the bgidemo0.cpp program you would give the compile command:
g++ bgidemo0.cpp -lbgi -lgdi32 -luser32 -o bgidemo0.exe
Note that each of these library options begins with the letter l (not the number one). This command creates an executable file called bgidemo0.exe. Note that when it runs, it creates a small graphics window where all the bgi operations are performed. Any text i/o with cin and cout will be done in the other (console) window.
呵呵,刚刚准备问楼上这个!
CGDI的包已经安装了,project的option里的complier也加了-l bgi -l gdi32
link里也加了libbgi.a,但还是出错!顺便问一下,在TC里用system("pause")怎么暂停不了啊,加了stdlib.h和stdio.h了
3 F:\TEMP\yaya\main.c In file included from main.c
389 D:\DEV\DEVCPP\include\winbgim.h parse error before "ismouseclick"
389 D:\DEV\DEVCPP\include\winbgim.h [Warning] data definition has no type or storage class
390 D:\DEV\DEVCPP\include\winbgim.h parse error before '&' token
[Linker error] undefined reference to `textbackground'
[Linker error] undefined reference to `textcolor'
[Linker error] undefined reference to `clrscr'