gpt4 book ai didi

c - Dev C++ 中 graphics.h 的 undefined reference ?

转载 作者:太空宇宙 更新时间:2023-11-04 00:03:13 25 4
gpt4 key购买 nike

我正在尝试使用 graphics.h 头文件并编写一个简单的程序来测试它是否有效。这是我写的程序

#include <graphics.h>

int main( )
{
initwindow(400, 300, "First Sample");
circle(100, 50, 40);
while (!kbhit( ))
{
delay(200);
}
return 0;
}

但是当我尝试编译和运行这个程序时,出现如下错误,

(.text+0x3d): undefined reference to `initwindow'
(.text+0x52): undefined reference to `circle'
(.text+0x5e): undefined reference to `delay'

我该怎么做才能解决这个问题?请帮忙。

最佳答案

如果你想在 linux 中使用 graphics.h,那么这个 link对你有用。

关于c - Dev C++ 中 graphics.h 的 undefined reference ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34412139/

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