在Dev C++中使用c语言图形库的配置

article/2025/1/10 12:04:17
[img]C:\Documents and Settings\Administrator\桌面\devcppEditor1.gif[/img]Dev-C++ Installation
If you are installing Dev-C++ on your own computer, you should make some changes and additions to the default installation. Here are the details. If you are planning on using GCC, then you're pretty much on your own since I prefer using a development system and will not be much help with the GCC command line parameters.

First of all we are using Dev-C++ 5 beta 9.2 (4.9.9.2) from the Bloodshed website. ( http://www.bloodshed.net/ ). Make sure you choose the installation that includes the minGW compiler.

After installing, you will have a dev-cpp folder on your c: drive. The folder names below refer to folders under the dev-cpp folder which by default is in the c: root folder, i.e. c:\. The following needs to be changed.

1) Change the user default directory changed to the location where you plan to put your projects. This is found in Tools/Environment Options/Files & Dirs.

2) Add the following files to the Templates folder (they can be found in this zip archive file, devcFiles.zip).

CS151.template (new)
ConsoleGDI.template (replacement)
BGI.ico (new)
cs151.ico (new)
CS151App_c.txt (new)
ConsoleGDI.txt (replacement)

3) Save libbgi.a & libconio.a from the zip archive to the lib directory.

4) Save winbgim.h, conio.h, and conio2.h from the zip archive to the include directory.

Testing Your Installation
To test whether all this has worked OK you can do the following.

1) To test the conio library, create a new cs151 Application project and then try to compile and run the following program.

#include <stdio.h>
#include <conio2.h>


int main(void)
{
  gotoxy(30,10);
  textcolor(LIGHTRED);
  printf("Hello World\n\n");

  getchar();
  return 0;
}

If you see a red "Hello World" in the middle of the screen, your conio library is working OK.

2) To test the graphics library, create a new Console GDI project and compile and run the default program. You should see a window with a white circle in the middle.

Running Lecture Programs
In order to run lecture programs, you must bring them into the proper kind of project folder. It is generally not sufficient to merely open the .c file in Dev-C++. All of the lecture programs were created as either a CS151 Application or a Console GDI project.

To run a nongraphics program create a CS151 Application project. Then copy the lecture source file into this project folder. Now remove the default source using the red X button (or use the green minus button). Then add the lecture source file to your project using the green plus button). You should now be able to compile and run the lecture program.

Follow the same procedure for a graphics program, but bring the source code into a Console GDI project.

Configuring the Dev-C++ Editor
In order to make formatting of you programs easier, I think the following changes to the editor are useful. First start up Dev-C++. Then select Tools/Editor Options and check the boxes on the General tab as shown to the right..

On the Display tab make sure Line Numbers is checked.

With these settings you should use the tab key (not the space bar) for indenting. After doing one indent, further lines will be automatically indented when you use the Enter key.

When you type a Backspace, the cursor will move to the previous tab position ready for further input.

When you get to the end of block of code, press Enter and then the '}' and the '}' will be placed one tab back from the current tab position as required by standard C formatting. This make formatting your C code easy.



Dev-C++ Debugging
The Dev-C++ debugger is a little temperamental. The symptom is the compile keeps asking you if you want to include debugging information and you say yes, but it never happens. Somehow Dev-C++ doesn't want to set the right linker switches to include debugging information in your compiled program. The following recipe has been working for me.

Do the following one time only.

Start up Dev-C++.
Change the linker setting Generate debugging information to the value no. To do this select the Tools/Compiler Options menu, then the Linker option on the Settings tab. Select Generate debugging information and change to no if it is set to yes.
Close Dev-C++.
Now everytime you start Dev-C++, that linker mode will be off. It seems that this must changed from no to yes when you want to debug. This is done following the steps below for each program you want to debug.

When you are ready to debug a program you have been working on do the following.

Change Generate debugging information to yes using the Tools/Compiler Options menu.
Set a break point at the beginning of your program.
Click on the debug tab at the bottom and then click the debug button on this tab.
You will get a message saying there is no debug information in the file, and do you want to generate it:. Answer yes. This will close the tabs at the bottom.
Again click on the debug tab and debug button and you should get a console window up and can now continue stepping through your program. At this point you can also add watch variables. This will allow you to see how your variables are changing as you step through your program.
  • devcFiles.zip (30.9 KB)
  • 下载次数: 66
  • 大小: 24 KB
  • 查看图片附件

http://chatgpt.dhexx.cn/article/aMt8gXoL.shtml

相关文章

利用DevC++和EGE图形库写出一款C语言飞机大战小游戏

利用DevC以及EGE图形库写出一款C语言飞机大战小游戏 前言&#xff1a; 上学期期末大作业利用C语言写过一个极其简陋的飞机大战&#xff08;只有黑洞洞的终端窗口&#xff0c;至于飞机&#xff0c;额&#xff0c;也是一言难尽&#xff09;&#xff0c;暑假闲来无事&#xff0c…

【c语言】五子棋(EasyX图形库+背景音乐)

大家好&#xff0c;有没有觉得写了好多c语言代码&#xff0c;面对的都是黑框框控制台&#xff0c;当我们学习了基础的c语言知识&#xff0c;和EasyX图形库后&#xff0c;终于可以和黑框框saygoodbye,今天要分享给大家的是小游戏五子棋&#xff0c;跟着小张一起学习吧 EasyX图形…

C语言课程设计图形库

记得刚上大学的时候&#xff0c;大一学C语言&#xff0c;最后有一个大作业&#xff0c;用的是Turbo C2.0&#xff0c;然后大部分设计题都需要用到里面的图形界面&#xff0c;也就是引用<graphics.h>.差不10年过去了&#xff0c;不知道现在的学生还用不用Turbo C&#xff…

C语言画图形(图形库graphics的使用)

目录 工具 c语言基本绘图 文字输出 c语言基本贴图 获取鼠标、键盘信息 工具 &#xff08;1&#xff09;环境&#xff1a;VC &#xff08;2&#xff09;库函数&#xff1a;graphics.h&#xff08;因为不是标准库函数&#xff0c;所以需下载EASYX&#xff09; &#xff08;3&am…

codeblock c语言图形库,C语言入门项目——扫雷游戏(ege图形库+codeblocks)

扫雷游戏适合C练手,会C基本语法就可以尝试。需要导入ege图形库(文章后半部分写了ege如何导入codeblocks,以及我用到的ege函数) 一、先介绍如何将ege图形库导入codeblocks: 1、下载codeblocks 2、下载ege图形库的文件包 官方网址:ege图形库主站 (1)打开下载好的压缩包,找到…

【精选】适合初学者小游戏井字棋(三子棋)(C语言),Easyx图形库应用+源代码分享

【精选】井字棋&#xff08;三子棋&#xff0c;C语言&#xff09; 目录 【精选】井字棋&#xff08;三子棋&#xff0c;C语言&#xff09;游戏展示一、项目环境简单介绍一下easyx图形库Easyx图形库 二、游戏规则介绍三、运行效果展示四、项目介绍五、项目源代码分享总结与思考B…

C语言图形库——EasyX基本贴图

在C语言的学习过程中&#xff0c;接触最多的就是黑乎乎的DOS窗口&#xff0c;这也是在消磨学习者的兴趣&#xff0c;学到最后可能还不知道C语言到底能做什么&#xff0c;难道就是输入输出数据吗&#xff1f;当然不是&#xff0c;C的用处很广泛&#xff0c;这里不做讨论。我们能…

#C语言或C++中强大的图形库——easyx

1.了解easyx图形库 EasyX Graphics Library 是针对 Visual C 的免费绘图库&#xff0c;支持 VC6.0 ~ VC2022&#xff08;以及VS2013~VS2022)&#xff0c;简单易用&#xff0c;学习成本极低&#xff0c;应用领域广泛。目前已有许多大学将 EasyX 应用在教学当中。 使用范围&…

产品 • B端和C端产品经理有什么区别?

一些概念 to-C产品分类&#xff1a; 直接触达型&#xff1a;类似一级市场——微信、微博等平台&#xff1b;间接触达型&#xff1a;二级市场——广告、公众号等 &#xff1b; 总的市场规模&#xff1a; 用户规模可用时间 —— 御豪同学 • 京东金融 • 数据产品经理 每位用户每…

B端产品思维全解析,提升产品经理核心竞争力

产品思维和用户思维组成了产品经理两大核心思维方法论。对两者的理解也代表了产品经理的产品理解方向。 很多人把产品思维和用户思维混在一起说&#xff0c;我觉得是不合适的&#xff0c;因为两个是互相搭配的关系&#xff0c;你也可以把产品思维理解成智商&#xff0c;用户思维…

全方位解析 C 端和 B 端的产品特性

近年来&#xff0c;互联网进入下半场&#xff0c;C 端流量红利逐渐消退&#xff0c;很多企业转向了 B 端服务&#xff0c;随之而来的是产品设计者的转型&#xff0c;现在越来越多的 C 端产品设计师开始涉足到 B 端产品的设计&#xff0c;这是一个知识迁移的过程&#xff0c;需要…

B端产品经理,应从哪些方面理解业务?

新人入职新公司后&#xff0c;第一个工作就是了解公司业务&#xff0c;一般都是看公司项目PPT、产品需求文档&#xff0c;根据现有系统功能梳理功能结构图、产品流程等方式&#xff0c;但并不能系统化地帮助我们了解公司业务&#xff0c;容易流于表面。 由于TO B业务往往具有鲜…

B端和C端产品区别

一、定义 B端的B是单词Business的缩写&#xff0c;即企业用户。 C端的C是单词Consumer的缩写&#xff0c;即个人用户。 二、区别 B端产品&#xff08;如**管理系统&#xff09;&#xff1a; B端产品注重操作的实用性&#xff0c;注重功能的实现效率&#xff0c;是为了工作而…

新入行的产品做C端还是B端?

作为一名产品经理&#xff0c;你是否曾思考过&#xff1a;新入行的产品&#xff0c;做C端还是B端发展前景更好&#xff1f; C端产品需要对用户需求有深刻的了解。你需要研究市场趋势、用户行为、竞争对手&#xff0c;然后设计出符合用户期望的产品。同时&#xff0c;你需要面对…

【产品经理】B端产品经理需知道几个市场概念

美国市场营销协会称&#xff1a;“市场是指一种货物或劳务的潜在购买者的集合需求。”简单的说市场是买卖双方交易的领域&#xff0c;有买方、有卖方、有商品或服务、有需求。我们可以简单的了解市场竞争程度、需求和供给模型和边际成本模型。 01市场竞争程度 《西方经济学》里…

为什么说用C端产品的思维做B端产品就是死路一条?

经常听行业大佬说起&#xff1a;如果用C端产品的思维做B端产品就是死路一条&#xff0c;那原因究竟是什么呢&#xff1f; 首先&#xff0c;需要明确的是C端产品和B端产品的用户群体和需求存在很大差异。C端产品的用户主要是消费者&#xff0c;更多的是被情感驱动。而B端产品的…

B端产品:通过线上渠道增长

老于笔记11.29 征服畏惧建立自信的最快最确实的方法&#xff0c;就是去做你害怕的事&#xff0c;直到你获得成功的经验。 前言 疫情让我们越来越重视线上流量。作为B端产品的市场运营&#xff0c;每天我有多少流量&#xff0c;从哪些地方来、转化情况如何&#xff0c;以及数据驱…

B端与C端产品区别

目录 一、B端与C端产品特点二、B端与C端产品区别三、B端和C端业务调研的区别四、B端和C端产品运营的区别五、产品的客户与用户六、两类用户的行为动机差异&#xff0c;决定了产品经理关注侧重点的差异七、决策优先级的差异 霸占大众视线的产品普遍都是C&#xff08;Customer&am…

C端产品和B端产品的区别

什么是B端产品&#xff1f; 典型的B端产品有CRM、ERP、OA、中台等。 什么是C端产品&#xff1f; C端则是微信、抖音、京东淘宝等。 B端产品和C端产品的区别&#xff1f; 一、面向用户不同 B端客户是企业级用户&#xff0c;用户群是稳定的、统一的。 B端产品面向的客户是企业…