如何在代码块中使用graphics.h? [英] How to use graphics.h in codeblocks?

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

问题描述

我最近开始在C ++中学习图形。



我尝试了 #include< graphics.h> 在我的程序中的代码块,但它显示错误。然后我从一个网站下载了 graphics.h 头文件并粘贴在代码块中的 include 文件夹中,但它显示了图形。 h:没有这样的文件或目录



任何人都可以教我如何使用 graphics.h /winbgim.codecutter.org/\">http://winbgim.codecutter.org/ 解压缩。

  • 将graphics.h和winbgim.h文件复制到include文件夹中您的编译器目录

  • 将libbgi.a复制到编译器目录的lib文件夹

  • 在代码:: blocks中打开设置>>编译器和调试器>>链接器设置
    单击链接库部分中的添加按钮并浏览并选择libbgi.a文件

  • 在右边部分(即其他链接器选项)粘贴命令
    -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32

  • 点击确定

  • 链接


    I have recently started learning graphics in C++.

    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.

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

    解决方案

    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 (ie. other linker options) paste commands -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
    6. click Ok

    For detail information follow this link.

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

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆