LoveUnix » 编程开发 & Rational » red hat 9 下 C 图形程序编译问题.
让LU留住您的每

一天 让LU博客留住您的每一天
2005-11-3 01:40 hd_dh
red hat 9 下 C 图形程序编译问题.

#include "graphics.h"
int main()
{
     int gdriver, gmode;
     gdriver=VGA;
     gmode=VGAHI;
     initgraph(&gdriver, &gmode, "c:\\tc");
     bar3d(100, 100, 300, 250, 50, 1);       /*画一长方体*/
     getch();
     closegraph();
     return 0;
}
在WIN XP下用TC2.0编译成功.为什么在RED HAT 9 下编译时提示找不到graphics.h.将该文件CP到源程序目录下后出现错误提示:

In file included from graphic.c:1:
graphics.h:241: parse error before "arc"
graphics.h:242: warning: data definition has no type or storage class
graphics.h:243: parse error before "bar"
graphics.h:243: warning: data definition has no type or storage class
graphics.h:244: parse error before "bar3d"
graphics.h:245: warning: data definition has no type or storage class
graphics.h:246: parse error before "circle"
graphics.h:246: warning: data definition has no type or storage class
graphics.h:247: parse error before "cleardevice"
graphics.h:247: warning: data definition has no type or storage class
graphics.h:248: parse error before "clearviewport"
graphics.h:248: warning: data definition has no type or storage class
graphics.h:249: parse error before "closegraph"
graphics.h:249: warning: data definition has no type or storage class
graphics.h:285: warning: data definition has no type or storage class
graphics.h:286: parse error before '*' token
graphics.h:286: warning: data definition has no type or storage class
graphics.h:372: warning: data definition has no type or storage class
graphics.h:373: parse error before "gothic_font_far"
graphics.h:373: warning: data definition has no type or storage class
graphics.h:377: stray '\32' in program
In file included from graphic.c:1:
graphics.h:377:2: warning: no newline at end of file
graphics.h:349: warning: array `CGA_driver_far' assumed to have one element
graphics.h:350: warning: array `EGAVGA_driver_far' assumed to have one element
graphics.h:351: warning: array `IBM8514_driver_far' assumed to have one element
graphics.h:352: warning: array `Herc_driver_far' assumed to have one element
graphics.h:353: warning: array `ATT_driver_far' assumed to have one element
graphics.h:354: warning: array `PC3270_driver_far' assumed to have one element
graphics.h:370: warning: array `triplex_font_far' assumed to have one element
graphics.h:371: warning: array `small_font_far' assumed to have one element
graphics.h:372: warning: array `sansserif_font_far' assumed to have one element
graphics.h:373: warning: array `gothic_font_far' assumed to have one element

(bbs限止删了很多行错误提示.)
好多warning好恐怖.这些警告信息我看不懂.请指教.谢谢!

2005-11-4 10:52 irror
linux 好象没有这个头文件 "graphics.h"
linux 下用ncures库

页: [1]


Powered by Discuz! Archiver 5.5.0  © 2001-2006 Comsenz Inc.