当前位置:首页 开发工具 > 正文

Dev-C++中解决graphics.h: No such file or directory错误

作者:野牛程序员:2023-09-25 08:48:12 开发工具阅读 4112

Dev-C++中解决graphics.h: No such file or directory错误

在Dev-C++中解决graphics.h: No such file or directory错误通常需要配置正确的开发环境,因为Dev-C++不包含graphics.h和BGI图形库。以下是解决该问题的一种方法:

  1. 安装 WinBGIm 图形库

    • 前往以下链接下载 WinBGIm 图形库:WinBGIm下载链接

    • 解压下载的文件,并将其中的 graphics.hwinbgim.h 文件复制到 Dev-C++ 的 include 文件夹中。通常,这个文件夹位于 C:\\Dev-Cpp\\MinGW64\\include(根据你的Dev-C++安装路径可能会有所不同)。

    • 将下载的 libbgi.a 文件复制到 Dev-C++ 的 lib 文件夹中。通常,这个文件夹位于 C:\\Dev-Cpp\\MinGW64\\lib

    • 最后,重启 Dev-C++。

  2. 配置 Dev-C++ 项目

    • 打开你的 Dev-C++ 项目。

    • 选择 "Project" 菜单下的 "Project Options"。

    • 在 "Parameters" 标签下,将 -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 添加到 "Linker" 标签中的 "Add these commands to the linker command line" 字段中。

    • 单击 "OK" 保存更改。

#include <iostream>
#include <graphics.h>


野牛程序员教少儿编程与信息学奥赛-微信|电话:15892516892
野牛程序员教少儿编程与信息学竞赛-微信|电话:15892516892
相关推荐

最新推荐

热门点击