分页: 1 / 1

[问题]gcc编译缺少头文件

发表于 : 2008-03-08 18:49
liaojingli
在网上下了一些高手编的c语言程序,用GCC编译时提示缺少头文件graphics.h
然后到tc下cp了一个过来还是用不了,怎么办阿???

发表于 : 2008-03-08 19:06
iblicf
你就直接贴编译器的输出,别演译了

发表于 : 2008-03-08 19:17
liaojingli
从tc里copy graphics.h过来后
出错信息:

代码: 全选

liao@liao-desktop:~/c$ gcc snake.c -o snake
In file included from snake.c:1:
graphics.h:241: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘arc’
graphics.h:243: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bar’
graphics.h:244: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bar3d’
graphics.h:246: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘circle’
graphics.h:247: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cleardevice’
graphics.h:248: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘clearviewport’
graphics.h:249: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘closegraph’
graphics.h:250: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘detectgraph’
graphics.h:251: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘drawpoly’
graphics.h:252: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ellipse’
graphics.h:254: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fillellipse’
graphics.h:255: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fillpoly’
graphics.h:256: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘floodfill’
graphics.h:257: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getarccoords’
graphics.h:258: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getaspectratio’
graphics.h:259: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getbkcolor’
graphics.h:260: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getcolor’
graphics.h:261: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getdefaultpalette’
graphics.h:262: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getdrivername’
graphics.h:263: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getfillpattern’
graphics.h:264: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getfillsettings’
graphics.h:265: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getgraphmode’
graphics.h:266: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getimage’
graphics.h:268: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getlinesettings’
graphics.h:269: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getmaxcolor’
graphics.h:270: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getmaxmode’
graphics.h:271: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getmaxx’
graphics.h:272: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getmaxy’
graphics.h:273: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getmodename’
graphics.h:274: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getmoderange’
graphics.h:276: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getpixel’
graphics.h:277: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getpalette’
graphics.h:278: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getpalettesize’
graphics.h:279: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘gettextsettings’
graphics.h:280: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getviewsettings’
graphics.h:281: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘getx’
graphics.h:282: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘gety’
graphics.h:283: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘graphdefaults’
graphics.h:284: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘grapherrormsg’
graphics.h:285: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_graphfreemem’
graphics.h:286: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
graphics.h:287: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘graphresult’
graphics.h:288: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘imagesize’
graphics.h:289: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initgraph’
graphics.h:292: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘installuserdriver’
graphics.h:293: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘installuserfont’
graphics.h:294: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘line’
graphics.h:295: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘linerel’
graphics.h:296: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘lineto’
graphics.h:297: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘moverel’
graphics.h:298: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘moveto’
graphics.h:299: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘outtext’
graphics.h:300: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘outtextxy’
graphics.h:301: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘pieslice’
graphics.h:303: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘putimage’
graphics.h:304: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘putpixel’
graphics.h:305: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rectangle’
graphics.h:306: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘restorecrtmode’
graphics.h:307: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘sector’
graphics.h:309: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setactivepage’
graphics.h:310: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setallpalette’
graphics.h:311: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setaspectratio’
graphics.h:312: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setbkcolor’
graphics.h:313: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setcolor’
graphics.h:314: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setfillpattern’
graphics.h:315: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setfillstyle’
graphics.h:316: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setgraphbufsize’
graphics.h:317: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setgraphmode’
graphics.h:318: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setlinestyle’
graphics.h:320: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setpalette’
graphics.h:321: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setrgbpalette’
graphics.h:323: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘settextjustify’
graphics.h:324: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘settextstyle’
graphics.h:325: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setusercharsize’
graphics.h:327: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setviewport’
graphics.h:329: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setvisualpage’
graphics.h:330: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘setwritemode’
graphics.h:331: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘textheight’
graphics.h:332: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘textwidth’
graphics.h:337: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘registerfarbgidriver’
graphics.h:349: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘CGA_driver_far’
graphics.h:350: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘EGAVGA_driver_far’
graphics.h:351: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘IBM8514_driver_far’
graphics.h:352: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Herc_driver_far’
graphics.h:353: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ATT_driver_far’
graphics.h:354: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PC3270_driver_far’
graphics.h:360: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘registerfarbgifont’
graphics.h:370: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘triplex_font_far’
graphics.h:371: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘small_font_far’
graphics.h:372: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘sansserif_font_far’
graphics.h:373: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘gothic_font_far’
graphics.h:377: 错误: 程序中有游离的 ‘\32’
在包含自 snake.c:1 的文件中:
graphics.h:377:2: 警告: 文件未以空白行结束

Re: [问题]gcc编译缺少头文件

发表于 : 2008-03-08 19:27
dbzhang800
liaojingli 写了:在网上下了一些高手编的c语言程序,用GCC编译时提示缺少头文件graphics.h
然后到tc下cp了一个过来还是用不了,怎么办阿???
graphics.h是 tc 特有的东西

发表于 : 2008-03-08 19:29
liaojingli
:em21 晕啊,那如果要编译这个程序怎么办
请高手指点阿,谢谢了 :em06 :em06

发表于 : 2008-03-08 19:34
ttand
graphics.h。。。。。。。。

bland tc的东西

当然都是 dos 和 bios 的功能的封装

graphics.h 本身只是个定义文件 而函数编译在 .lib 静态库里面 这个和gcc不兼容 linux也没提供有此库的下层接口

在linux下没法用

发表于 : 2008-03-15 1:05
monnand
liaojingli 写了::em21 晕啊,那如果要编译这个程序怎么办
请高手指点阿,谢谢了 :em06 :em06
改代码

发表于 : 2008-03-15 11:46
BigSnake.NET
TC 的东西是DOS下的东西
跟Linux不通用的

make menuconfig报错

发表于 : 2010-12-20 21:34
河软王小军
wang@ubuntu:~/桌面/17.kernel/linux-2.6.34$ make menuconfig *** Unable to find the ncurses libraries or the
*** required header files.
*** 'make menuconfig' requires the ncurses libraries.
***
*** Install ncurses (ncurses-devel) and try again.
***
make[1]: *** [scripts/kconfig/dochecklxdialog] 错误 1
make: *** [menuconfig] 错误 2

Re: [问题]gcc编译缺少头文件

发表于 : 2010-12-20 21:35
cnkilior
*** Unable to find the ncurses libraries or the
*** required header files.
*** 'make menuconfig' requires the ncurses libraries.
***
*** Install ncurses (ncurses-devel) and try again.
***
make[1]: *** [scripts/kconfig/dochecklxdialog] 错误 1
make: *** [menuconfig] 错误 2

谢谢了,好不容易找到解决方案了。