如何在代码块中使用 graphics.h?

2023-09-27C/C++开发问题
2

本文介绍了如何在代码块中使用 graphics.h?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我最近开始学习 C++ 中的图形.

I have recently started learning graphics in C++.

我在代码块中的程序中尝试了 #include 但它显示错误.然后我从一个站点下载了 graphics.h 标头并粘贴到代码块中的 include 文件夹中,但它显示 graphics.h:No such file or directory.

I tried #include <graphics.h> in my program in codeblocks but it shows error. Then I downloaded graphics.h header from a site and pasted in the include folder in codeblocks, yet it shows graphics.h:No such file or directory.

谁能教我如何在代码块中使用 graphics.h?

Can anyone teach me how to use graphics.h in codeblocks?

推荐答案

  1. 首先从 http://winbgim.codecutter.org/ 下载 WinBGIm.
  2. graphics.hwinbgim.h 文件复制到编译器目录的include 文件夹中
  3. libbgi.a 复制到编译器目录的 lib 文件夹中
  4. 在代码::块中打开设置>>编译器和调试器>>链接器设置单击链接库部分中的添加按钮并浏览并选择libbgi.a 文件
  5. 在右侧(即其他链接器选项)粘贴命令-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
  6. 点击确定
  1. First download WinBGIm from http://winbgim.codecutter.org/ Extract it.
  2. Copy graphics.h and winbgim.h files in include folder of your compiler directory
  3. Copy libbgi.a to lib folder of your compiler directory
  4. In code::blocks open Settings >> Compiler and debugger >>linker settings click Add button in link libraries part and browse and select libbgi.a file
  5. In right part (i.e. other linker options) paste commands -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
  6. Click OK

有关详细信息,请访问此链接.

For detail information follow this link.

这篇关于如何在代码块中使用 graphics.h?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&amp;()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6