ege图形化编程配置过程及出现的问题解决方法

devc++ 版本 4.9.2

首先在官网下载ege

在devc++中新建项目-选择 console Application

在新建的项目左侧栏右击项目名称-点击项目属性

点击后

按照1、2、3的顺序点击

找到你下载的ege的路径,选择include文件夹,点击确定,再点击添加。

点击添加后路径显示在上方。

同理,在“包含文件目录”的左边“库目录”中添加ege的lib文件(注意!!!!不是看到的第一个lib目录!!!是它的子目录里选mingw4.8.1的子目录lib)

 

如果你选的是第一个出现的lib 在后面编译运行时会报错  cannot find -lgraphics

导入后记得点击“添加”,看到的效果如图

然后点“参数”,输入一段字符串

32位输入   -lgraphics -lgdi32 -limm32 -lmsimg32 -lole32 -loleaut32 -lwinmm -luuid -mwindows
64位输入   -lgraphics64 -lgdi32 -limm32 -lmsimg32 -lole32 -loleaut32 -lwinmm -luuid -mwindows

点击确定

在main.cpp中写以下代码测试:

#include <iostream> 
#include "graphics.h" 
/* run this program using the console pauser or add your own getch, system("pause") or input loop */ 
 
int main(int argc, char** argv) {  
    initgraph(200, 200); 
 
    outtextxy(60, 100, "Hello World!"); 
 
    circle(100, 100, 50); 
 
    ege::getch();  closegraph(); 
 
    return 0; 
 } 

点击编译运行

正确显示下图则配置成功

出现的问题(在上述对应步骤中已经提到):

在编译的时候一直报错

cannot find -lgraphics

后来发现是在库目录中添加lib文件错误(选其子目录的子目录lib才对!!!!)

原文地址:https://www.cnblogs.com/qq1337822982/p/9925615.html