gpt4 book ai didi

c++ - 如何将 Graphics.h 包含在 Codelite 中?

转载 作者:行者123 更新时间:2023-11-30 20:34:41 24 4
gpt4 key购买 nike

有没有办法在Codelite中包含graphics.h库?我不想使用 CodeBlocks 或 Devc++。我的大学项目需要它。我知道如何将它包含在 CodeBlocks 和 Devc++ 中,但是当我使用我在 Codelite 中编写的旧代码时,会出现很多错误。 screenshot _screenshot

最佳答案

有趣......这对我有用

我写了一个小程序

#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;
}

并编译它。它在名为“project”的调试文件夹中创建了一个二进制文件。当我双击运行它时,它没有显示任何内容。所以

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 !!!

我知道这不是解决方案,但仍然是一个起点......

编辑:我有一个双显示器,当我将 cmd 提示符带到一个显示器上时,它可以工作,而在另一个显示器上则不起作用......可能它与显示参数有关,但我不确定......

enter image description here

关于c++ - 如何将 Graphics.h 包含在 Codelite 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41823269/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com