无法运行C图形程序

发布于 2024-08-27 05:22:32 字数 161 浏览 8 评论 0原文

我在桌面系统上开发了一个图形程序。但是当我尝试在惠普康柏笔记本电脑上运行它时,它没有被执行。我使用 Turbo C 开发了它。然后我尝试在笔记本电脑上用 Turbo C 编写一个简单的图形程序,但我遇到的问题是在“initgraph”语句中它无法检测到驱动程序。

你能告诉我可能是什么问题吗?

I have developed a graphic program on a desktop system. But when I tried to run it on the hp compaq laptop it's not getting executed. I developed it using Turbo C. Then i tried writing a simple graphic program in Turbo C on the laptop, but the problem I am getting is in 'initgraph' statement it is unable to detect the driver.

Can you please tell me what might be the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

流殇 2024-09-03 05:22:33

Turbo-C,就像我的第一个女朋友一样,将永远在我心中占有特殊的位置。

但现在是时候让她离开了。她已经不是你记忆中的那个女孩了,她只是跟不上现代了。当时的她可能很时髦很酷,但她根本无法应对现代潮流。即使是 32 位内存对她来说也是一个真正的挑战。你现在是一个更好的男人了,值得一个真正的女人。去找一个好的 Visual Studio,或者一个好的 GCC 环境。

我并不是说你必须忘记 Turbo-C。我知道她是你的第一个女人,并且永远都很神奇,但是把她的照片放在鞋盒里,每年拿出来的次数不要超过一次。是时候继续前进了,伙计。

Turbo-C, much like my first girlfriend, will always have a special place in my heart.

But its time to let her go. She's not the same girl you remember, and just cannot keep up with modern times. She may have been hip and cool at the time, but she can't handle modern trends at all. Even 32-bit memory is a real challenge for her. You're a better man now, and deserve a real woman. Go find yourself a good Visual Studio, or a nice GCC environment.

I'm not saying you have to forget Turbo-C. I know she was your first and will always be magical, but put her pictures in a shoebox, and don't take them out more than once a year. Its time to move on, buddy.

囍笑 2024-09-03 05:22:33

听起来它无法检测您拥有哪种显卡。尝试将 graphdriver 参数设置为 VGAIBM8514

It sounds like it can't detect what kind of graphics card you have. Try setting the graphdriver parameter to either VGA or IBM8514.

紫竹語嫣☆ 2024-09-03 05:22:33

在 Turbo c 中转到选项->链接器->库->添加图形库。
这可能有帮助

In Turbo c goto options->Linker->Liabraries-> add Graphics Library.
It might help

惜醉颜 2024-09-03 05:22:33

我假设所有其他先决条件(例如链接器)都得到满足。

现在,我们知道 BGI 文件夹通常位于以下路径(即,如果您遵循默认安装):

C:\TurboC++\disk\TurboC3\BGI

如您所见,BGI 文件夹位于“TurboC3”内,而不是 TC 内。
因此,您需要在程序中放入的代码如下,

initgraph(&gd, &gm, "C:\\TurboC3\\BGI");

我希望这会有所帮助:) 快乐的图形编程:D

I'm assuming that all the other prerequisites like linkers are satisfied.

Now, as we know the BGI folder is usually in the following path(i.e. if you've followed the default installation):

C:\TurboC++\disk\TurboC3\BGI

As you can see the BGI folder is inside "TurboC3" and not TC.
So the code you need to put in your program is as follows,

initgraph(&gd, &gm, "C:\\TurboC3\\BGI");

I hope this helps :) Happy graphics programming :D

淡淡離愁欲言轉身 2024-09-03 05:22:33

您需要先初始化图形函数。
下面是初始化的代码。

int gd=检测,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");

这将初始化图形。

you need to initialize the graphics function first.
below is the code to initialize.

int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");

this will initialize the graphics.

终遇你 2024-09-03 05:22:33

使您的TC能够运行图形程序的步骤如下:

  1. 从TC\BGI文件夹中复制CGA.BGI和EGAVGA.BGI文件并将其粘贴到TC\BIN目录中。

  2. 通过单击 TC\BIN\TC.EXE 打开 TC。

  3. 点击选项->链接器->库。

  4. 选择“图形库”选项,然后按“确定”。

  5. 现在您可以在零编译错误的情况下编译图形程序。

谢谢!

The Steps to make your TC able to run graphics program are as follows:

  1. copy CGA.BGI and EGAVGA.BGI files from TC\BGI folder and paste them in TC\BIN directory.

  2. Open TC by clicking on TC\BIN\TC.EXE.

  3. Click on Options -> Linker -> Libraries .

  4. Select the Graphics Library option and Press OK.

  5. Now you can compile your graphics program with Zero Compilation Errors.

Thanks!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文