画矩形.exe - 1 error(s), 0 warning(s),出现错误无法运行啊?

程序如下:

#include<graphics.h> 
main() 
{int gdriver=DETECT,gmode; 
initgraph(&gdriver,&gmode,"c:\\tc"); 
cleardevice(); 
moveto(160,120); 
lineto(480,120); 
lineto(160,360); 
lineto(160120); 
getch(); 
closegraph(); 


运行结果如下:

ompiling...
画矩形.cpp
f:\画矩形.cpp(1) : fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory
Error executing cl.exe.

DIEA
浏览 166回答 2
2回答

HUX布斯

编译这个代码之前,先安装easyx库,然后就会有graphics.h头文件,就能完美编译执行。

叮当猫咪

graphics.hvc里面没有这个头文件的最好有tc2.0试试,tc里很多函数和头文件在vc里是不被包含的。
打开App,查看更多内容
随时随地看视频慕课网APP