|
我在/usr/lib/bcc/include/下找不到<graphics.h>但有个<grp.h>是不是一样的?
原文<ex20.c>如下:
1 #include <graphics.h>
2 #include <math.h>
3 #define pi 4.1415926
4
5
6 main(argc,argv)
7 int argc;char *argv[];
8 {
9 int x,y,r1,rs,color;
10 double a;
11 int gdriver=DETECT,gmode;
12 if(strcmp(argv[1],"pass")!=0)
13 {
14 printf("password error!\n");
15 exit(0);
16 }
17 initgraph(&gdriver,&gmode,"..\\bgi");
18 r1=atoi(argv[2]);
19 rs=atoi(argv[3]);
20 color=atoi(argv[4]);
21 cleardevice();
22 setbkcolor(color);
23 setcolor(4);
24 for(a=0;a<=2*pi;a+=pi/1
25 {
26 x=r1*cos(a)+320;
27 y=r1*sin(a)+240;
28 circle(x,y,rs);
29 }
30 getch();
31 closegraph();
32 }
[muggle@localhost three]$ gcc -o ex20a ex20a.c -lm
ex20a.c:1:22: graphics.h: 没有那个文件或目录
ex20a.c: In function `main':
ex20a.c:11: `DETECT' undeclared (first use in this function)
ex20a.c:11: (Each undeclared identifier is reported only once
ex20a.c:11: for each function it appears in.)
[muggle@localhost three]$
这个怎么做啊 |
|