BGI错误,如何解决?
我想运行一个画圆的C 程序。该程序正在编译,没有错误并且正在运行。从用户那里获取半径等值后,我收到如下错误:
BGI error: Graphics notinitialed ( use "initgraph")
即使在我的源代码中我添加了这一行:
int gmode,gdrive=DETECT;
initgraph(&gdrive,&gmode,"c\\tc\\bgi");
仍然我出现错误。
我使用的是Windows,但我不知道我哪里出了问题。有人可以在这方面帮助我吗?
提前致谢。
I want to run a C program that draws a circle. The program is compiling with no error and it is running. After getting the values like radius from the user, I get the error like this :
BGI error: Graphics not initialized ( use "initgraph")
Even though in my source code I have added this line :
int gmode,gdrive=DETECT;
initgraph(&gdrive,&gmode,"c\\tc\\bgi");
Still I'm getting error.
I'm using Windows and I couldn't figure out where I went wrong. Can anyone help me in this regard?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您在
initgraph
中的路径是错误的。请改用"c:\\tc\bgi"
。Your path in
initgraph
is wrong. Use"c:\\tc\bgi"
instead.如果您在运行图形程序时收到此错误消息:
BGI Error: Graphics notinitialed (use 'initgraph')
只需将 \tc\bgi\EGAVGA.BGI 文件复制到本地运行应用程序的文件夹。
If you get this error message when you run your graphics program:
BGI Error: Graphics not initialized (use 'initgraph')
Just you need to copy the \tc\bgi\EGAVGA.BGI file to your local folder where you are running the application.
尝试这个(它对我有用):
BGI 文件夹通常位于以下路径中,
C:\TurboC++\disk\TurboC3\BGI
所以您需要放置的代码在你的程序中如下所示,
Try this (it worked for me) :
The BGI folder is usually in the following path,
C:\TurboC++\disk\TurboC3\BGI
So the code you need to put in your program is as follows,
我也深受这个问题的困扰。
简而言之:
这里
c:\tc\bgi
很重要。最重要:
在
tc.exe
(您正在使用的)中,顶部有一些菜单,例如文件、编辑、选项:注意:在输出中,如果它给出有关bgi的错误,请忽略它,只需在需要时提供程序的输入,它就会为您提供图形输出。享受。
I also suffered from that problem.
Simply put this line:
here
c:\tc\bgi
is important.MOST IMPORTANT:
In
tc.exe
(which you are using) at top are some menus like file, edit, options:NOTE: in the output, if it gives an error about bgi, ignore it, just give the input for the program if it is required and it will give you the graphics output. Enjoy.
可能有多种原因:
Could be multiple reasons:
如果通过包含“C:\tc\bgi”仍然存在错误,请尝试以下操作:
转到文件->更改目录..
将其更改为 bgi..但这必须在每次打开 Turboc 时完成
if by including "C:\tc\bgi" still the error persists , try this:
goto file-> change directory..
change it to bgi.. but this has to be done every time u open the turboc