最近我在网上看到一个用C语言编程输出一个矩形的程序,但是照着程序复制一遍,运行时出现如下错误:
error:undefine symbol 'DELECT'
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
int left, top, right, bottom;
initgraph(&gdriver, &gmode, "");
errorcode = graphresult();
if (errorcode != grOk) {
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); }
left = getmaxx() / 2 - 50;
top = getmaxy() / 2 - 50;
right = getmaxx() / 2 + 50;
bottom = getmaxy() / 2 + 50;
rectangle(left,top,right,bottom);
getch();
closegraph();
return 0;
}
哪位大虾看看出了什么问题
在找,没发现,,,可能太菜鸟了。
讲得很清楚的吧,引用变量没有定义,DELECT变量没有定义的啊。。。
感觉原因可能是conio.h文件不是标准的库文件,你没有调用到吧。
改DELECT为DETECT,