如何在 code::blocks 中使用graphics.h 编译和运行程序?

发布于 2024-10-18 11:35:32 字数 118 浏览 7 评论 0原文

我是 code::blocks 的新手,所以我想知道如何在 Code::Blocks 中编译和运行我的计算机图形动画程序(那些使用 graphics.h 的程序)。

默认安装可以吗?

I am new to code::blocks, so I was wondering how could I compile and run my computer graphics animation programs (those that use graphics.h) in Code::Blocks.

Is this possible with the default installation?

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

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

发布评论

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

评论(1

耳根太软 2024-10-25 11:35:32

这是不可能的。如果没有时间机器,您就无法使用graphics.h,因此您最好完全忘记它。这个问题每周都会被问一次,而且共识总是相同的。

graphics.h 头文件是早在 20 世纪 80 年代初就包含在 Borland 编译器中的专有图形库。它不是标准的 C 或 C++ 库,并且至少 20 年来一直不现代化或不相关。它不适用于现代编译器或现代操作系统,这不足为奇。使用或学习使用它完全是浪费时间。如果您的教育系统坚持要求您这样做,您应该有权获得全额学费退款。

很高兴您升级到像 Code::Blocks 这样的现代 IDE。您还应该在使用时升级您的库和工具包。如果您想编写图形应用程序,那么毫无疑问您将在 Windows 或 X 等图形环境中进行操作。您不妨学习在那里执行此操作的方法,而不是编写代码出现在 MS-DOS 模拟器中,并对复古技术的吸引力感到惊叹。

This is impossible. You can't use graphics.h without a time machine, so you're better off forgetting about it altogether. This question gets asked about once a week, and the consensus is always the same.

The graphics.h header is a proprietary graphics library included with Borland compilers back in the early 1980s. It is not a standard C or C++ library, and hasn't been modern or relevant for at least 20 years. It should come as no surprise that it does not work with modern compilers, or on modern operating systems. Using or learning to use it is an utter and complete waste of time. If your educational system is insisting upon you doing so, you should be entitled to a complete refund of your tuition.

It's good that you're moving up to a modern IDE like Code::Blocks. You should also upgrade your library and toolkits while you're at it. If you want to write graphics applications, you're undoubtedly going to be doing so in a graphical environment like Windows or X. You might as well learn the way to do it there, rather than getting lines to appear in an MS-DOS emulator and marveling at the appeal of retro tech.

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