急,求高人指点,tc可运行,但borland c 3.1出错!
<P>求高人指点,谢谢<BR>程序tc下可以正常运行,但到了borland c 3.1下面<BR>编译没有问题,make 就出很多链接错误<BR>Linker Error:undefined symbol _initgraph in module ERROR.C<BR>Linker Error:undefined symbol _ cleardevice in module ERROR.C<BR>Linker Error:undefined symbol _ line in module ERROR.C<BR>Linker Error:undefined symbol _moveto in module ERROR.C<BR>...<BR><BR>程序很简单<BR><BR>#include <graphics.h><BR>#include <stdio.h><BR>#include <conio.h><BR><BR>void main()<BR>{<BR> int gdriver=DETECT,gmode;<BR> initgraph(&gdriver,&gmode,"C:\\BC45\BGI");<BR> cleardevice();<BR> moveto(300,35);<BR> printf("ATM");<BR> line(80,60,560,60);<BR> line(560,60,560,420);<BR> line(560,420,80,420);<BR> line(80,420,80,60);</P><P> moveto(190,80);<BR> outtext("Welcome to use ATM service!");</P>
<P> setbkcolor(1);<BR> getch();<BR> closegraph();<BR>}<BR></P>
borland c 3.1<BR>没有initgraph(),cleardevice(),moveto(),line()...这样的库函数.<BR> 呵呵,在Turboc ++ 、borland C++ 下系统默认不加载图形库,如下步骤即可:<BR> [Options]--->[Linker]--->[Libraries...]<BR> 在弹出的对话框中,Graphics library 前面打勾即可编译通过。 BC的IDE并没有将graphics.lib设置为默认链接<BR>你必要手动设置一下:<BR>Options -> Linker -> Libraries...<BR>将"Libraries"标签下的"[ ]Graphics library"前面的选框"[ ]"勾上,即变成"[X]"<BR>然后再编译试试吧。
页:
[1]
