| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4329 人关注过本帖
标题:在TC中运行一个画圆程序,出错,Graphics error:Device driver file not fo ...
只看楼主 加入收藏
qvbhsskg
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2005-4-28
收藏
 问题点数:0 回复次数:7 
在TC中运行一个画圆程序,出错,Graphics error:Device driver file not found
在运行画圆程序时出现,,

Graphics error:Device driver file not found <EGAVGA.BGI>

Press any key to halt: 我的源程序是:

#include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h>

int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy; int radius = 100;

/* initialize graphics and local variables */ initgraph(&gdriver, &gmode, "");

/* read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ { printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); /* terminate with an error code */ }

midx = getmaxx() / 2; midy = getmaxy() / 2; setcolor(getmaxcolor());

/* draw the circle */ circle(midx, midy, radius);

/* clean up */ getch(); closegraph(); return 0; }

搜索更多相关主题的帖子: Graphics Device found driver error 
2005-04-28 13:15
yuki
Rank: 2
等 级:新手上路
威 望:5
帖 子:508
专家分:0
注 册:2005-2-4
收藏
得分:0 
这个不是TC3.0帮助文件中的一个例子吗?在运行前请确认一下你Tc\Bgi目录下是否有egavga.bgi文件。。。

没有的话下载一个。。。
jui5QIT1.rar (4.28 KB) 在TC中运行一个画圆程序,出错,Graphics error:Device driver file not found


我们都在命运湖上荡舟划桨,波浪起伏使我们无法逃离孤行;如果我们迷失方向,波浪将指引我们穿过另一天曙光
2005-04-28 19:06
lycnsc
Rank: 1
等 级:新手上路
帖 子:243
专家分:0
注 册:2005-3-27
收藏
得分:0 
你应该在initgraph(&gdriver, &gmode, "" ); 中的红色部分里给出egavga.bgi文件的路径或者将egavga.bgi绑定程序,即可!
2005-04-28 19:38
─━☆vb打渔者
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2004-10-31
收藏
得分:0 
?

2005-04-29 06:39
流浪魂
Rank: 1
等 级:新手上路
帖 子:34
专家分:0
注 册:2005-4-21
收藏
得分:0 
最好是确定“ ”里面的路径

何谓菜鸟?,呵呵,就是会吃菜的鸟。
2005-04-29 19:32
lycnsc
Rank: 1
等 级:新手上路
帖 子:243
专家分:0
注 册:2005-3-27
收藏
得分:0 

#include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h>

int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy; int radius = 100;

/* initialize graphics and local variables */ registerbgidriver(EGAVGA_driver);/*将egavga.bgi文件绑定进.obj文件后,要增加这行,这样你的程序可以脱离TC运行 */ initgraph(&gdriver, &gmode, "");

/* read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ { printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); /* terminate with an error code */ }

midx = getmaxx() / 2; midy = getmaxy() / 2; setcolor(getmaxcolor());

/* draw the circle */ circle(midx, midy, radius);

/* clean up */ getch(); closegraph(); return 0; }

[此贴子已经被作者于2005-5-5 14:32:25编辑过]

2005-05-05 14:30
时空之蕊
Rank: 2
等 级:新手上路
威 望:3
帖 子:691
专家分:0
注 册:2004-10-31
收藏
得分:0 
在option选项里面的Graphic选上了马??

我渴望掌控时空的核心——用最先进的技术,打造无比美丽的世界!
2005-05-05 14:34
michealone
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-8-19
收藏
得分:0 

EGAVGA.BGI文件与源文件放在同一个目录下

2007-09-11 10:55
快速回复:在TC中运行一个画圆程序,出错,Graphics error:Device driver file n ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018242 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved