简体   繁体   English

如何在 Codelite 中包含 graphics.h?

[英]How Do I include graphics.h in Codelite?

Is There a way to include graphics.h library in Codelite?有没有办法在 Codelite 中包含 graphics.h 库? I don't want to use CodeBlocks or Devc++.我不想使用 CodeBlocks 或 Devc++。 I need it for my university project.我的大学项目需要它。 I know how to include it in CodeBlocks and Devc++ but there are a lot of errors when I use my old code I Wrote in Codelite.我知道如何将它包含在 CodeBlocks 和 Devc++ 中,但是当我使用我在 Codelite 中编写的旧代码时会出现很多错误。 screenshot _screenshot截图_截图

Interesting... This worked for me有趣......这对我有用

I wrote a small program我写了一个小程序

#include <graphics.h>
#include <stdio.h>
#include <conio.h>


int main()
{ 
   int x = 320, y = 240, radius;
 
   initgraph();
 
   for ( radius = 25; radius <= 125 ; radius = radius + 20)
      circle(x, y, radius);
 
   getch();
   return 0;
}

and compiled it.并编译它。 It created a binary in the Debug folder named 'project'.它在名为“project”的 Debug 文件夹中创建了一个二进制文件。 When I run it by double clicking it does not show anything.当我通过双击运行它时,它不显示任何内容。 So所以

1) I opened cmd
2) dragged the binary into it.. It saved me the time to type the path myself
3) Pressed enter
4) Does not work the first time
5) Pressed a key to come back to prompt
6) Pressed up key to execute the binary again and pressed enter
7) Did step 6 on the other display and it worked !!!

I know this is not a solution but still a starting point....我知道这不是解决方案,但仍然是一个起点......

EDIT: I have a dual display and when I take the cmd prompt to one display it works and on the other it doesnt work... Probably it has something to do with the display parameters but I am not sure...编辑:我有一个双显示器,当我将 cmd 提示符带到一个显示器上时,它可以工作,而在另一个显示器上却不起作用……可能与显示参数有关,但我不确定……

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM