如何在CodeBlocks中添加头文件graphics.h
来源:互联网 发布:淘宝怎么改评价 编辑:程序博客网 时间:2024/05/16 13:59
Steps to include graphics.h in CodeBlocks:
Step 1: Download WinBGIm from http://winbgim.codecutter.org/ or use this link.
第一步:点击网站 http://winbgim.codecutter.org/或者这个连接 link下载文件WinBGIm
Step 2: Extract the downloaded file. You’ll get three files:
- graphics.h
- winbgim.h
- libbgi.a
- graphics.h
- winbgim.h
- libbgi.a
Step 3: Copy and paste graphics.h and winbgim.h files into the include folder of your compiler directory. (If you have Code::Blocks installed in C drive of your computer, go through: Disk C >> Program Files >> CodeBlocks >> MinGW >> include. Paste these two files there.)
第三步:复制graphics.h 和 winbgim.h,粘贴到包含编译器目录下的文件夹。(如果你把codeblock安装在C盘上,粘贴到这里:C盘 >> Program Files >> CodeBlocks >> MinGW >> include)
Step 4: Copy and paste libbgi.a to the lib folder of your compiler directory.
第四步:复制 libbgi.a,粘贴到你的编译目录的lib文件夹。
Step 5: Open Code::Blocks. Go to Settings >> Compiler >> Linker settings.
第五步:打开codeblock,点击Settings >> Compiler >> Linker settings。
Step 6: In that window, click the Add button under the “Link libraries” part, and browse and select the libbgi.a file copied to the lib folder in step 4.
第六步:点击在Link libraries部分下的Add,选择 libbgi.a
Step 7: Go to “Other linker options” on the right part and paste these commands:
[highlight color=”yellow”]-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32[/highlight]
第七步:点击“Other linker options”,并粘贴以下文字:
[highlight color=”yellow”]-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32[/highlight]
Step 8: Make sure you got steps 6 and 7 right! Here’s a screenshot of previous two steps. Then, click Ok.
第八步:确保你第6,7步正确,具体可参考下图,再点击OK。
Global Compiler Settings >> Linker SettingsStep 9: If you now try compiling a graphics.h program code in C or C++, you’ll still get error. To solve it, open graphics.h file (pasted in include folder in step 3) with Notepad++. Go to line number 302, and replace that line with this line:
[highlight color=”yellow”]int left=0, int top=0, int right=INT_MAX, int bottom=INT_MAX,[/highlight]
Save the file. Done!
Now you can compile any C or C++ program containing graphics.h header file. If you compile C codes, you’ll still get an error saying: “fatal error: sstream : no such file directory”. For this issue, if your file extension is .c, change it to .cpp.
第九步:用Notepad++打开graphics.h,找到第302行,删改为以下文字:
[highlight color=”yellow”]int left=0, int top=0, int right=INT_MAX, int bottom=INT_MAX,[/highlight]
保存文件就OK啦!但是如果你新建.c文件又用上了graphics.h 头文件,那么编译器还是会报错,要改为.cpp文件。
- 如何在CodeBlocks中添加头文件graphics.h
- 如何在VC6.0中使用使用头文件graphics.h
- graphics.h头文件详解
- TC 3.0下如何使用graphics.h画图头文件
- 在codeblocks中在project工程中如何成功的添加可执行的headers头文件,以Sale_data类为例
- C++如何在.h头文件中直接定义函数
- codeblocks找不到openssl/md5.h头文件
- 如何在QT中添加.lib,.dll还有.h文件
- codeblocks+wxwidgets+boost搭建c++开发平台步骤||如何在CodeBlock中添加boost库文件
- CodeBlocks主程序添加头文件失败解决方法
- 如何防止反复添加.h文件(头文件)
- 如何添加系统中的头文件(.h)到当前项目
- 如何添加"common.h"这样的头文件
- 在头文件中添加文件注释
- 添加头文件apue.h
- 添加mysql.h头文件
- 在自己的VS10里添加了.h文件后,如何包含这个头文件的路径的方法
- 如何在Axis2中添加SOAP头
- TangentSpace的法线转换到ViewSpace
- SHADOWMAP
- Shadow Map ———— PCF(percentage-closer filtering)
- liunx误删文件回复方式
- Shadow Map ———— PCSS(percentage-closer Soft Shadow)
- 如何在CodeBlocks中添加头文件graphics.h
- liunx删除了之后没有释放空间
- 推荐系统大师项亮都来了,就问你约不约?
- 从inotify机制说到FileObserver实现原理
- 网络编程学习笔记一:Socket编程
- 如何在Java中构造多维动态数组以及多维动态数组的使用
- HDU 3974 Assign the task(并查集)
- Spring集成Shiro HelloWorld之初步实现登陆及验证
- hadoop机架感知