小程序编译出错
#include<graphics.h>void main()
{
int driver,mode;
int i;
driver=DETECT;
mode=0;
initgraph(&driver,&mode,"");
moveto(0,200);
for(i=0;i<16;i++)
{
setcolor(i);
linerel(20,0);
}
getch();
restorecrtmode();
}
提示信息:
Compiling D:\tu.c:
Linking c\tu.exe:
Linker Error:Undefined symbol _restorecrtmode in module d:tu.c
Linker Error:Undefined symbol _linerel in module d:tu.c
Linker Error:Undefined symbol _setcolor in module d:tu.c
Linker Error:Undefined symbol _moveto in module d:tu.c
Linker Error:Undefined symbol _initgraph in module d:tu.c
搜索更多相关的解决方案:
编译
----------------解决方案--------------------------------------------------------
我这里没有错,可能你的编译器不支持graphics.h
----------------解决方案--------------------------------------------------------
回复:(nuciewth)我这里没有错,可能你的编译器不支持...
我用borland c 3.1和tc3.0均不能通过,我用的是运行命令. ----------------解决方案--------------------------------------------------------
程序没错,我WINTC通过了,可能你的编译器的路径不对吧,你看下
----------------解决方案--------------------------------------------------------
我们C-FREE3.5也不支持graphics.h
请问有什么办法可以解决吗?
----------------解决方案--------------------------------------------------------
'graphics.h': No such file or directory
----------------解决方案--------------------------------------------------------
找图形驱动程序吧
----------------解决方案--------------------------------------------------------
驱动程序*BGI,根据不同的图形
适配器有不同的图形驱动程序。例如对于EGA、 VGA 图形适配器就调用驱动程序
EGAVGA.BGI。
----------------解决方案--------------------------------------------------------