collect2:错误:ld 返回 1 个退出状态图形
collect2: error: ld returned 1 exit status graphics.h
我在 Ubuntu 14 中使用 graphics.h 库我在使用这个简单的代码时遇到问题:
#include <graphics.h>
main(){
int gd = DETECT, gm;
initgraph(&gd, &gm, "C:\TC\BGI");
putpixel(25, 25, RED);
closegraph();
getch();
return 0;
}
当我编译它时,它给了我这个错误
collect2:错误:ld 返回 1 个退出状态
我不知道我做错了什么。
假设您已经安装了所有必要的软件包,
更改: initgraph(&gd, &gm, "C:\TC\BGI");
收件人: initgraph(&gd, &gm, NULL);
并用 lgraph 标志编译它
示例:文件名为图形.cpp
g++ graph.cpp -o graph -lgraph
相关文章:
- 我不断收到 [错误] ID 返回 1 退出状态错误,但看不到问题所在
- 为什么系统函数总是在C++中返回已转移的退出状态?
- C++ 中的编译错误:未定义对"主"的引用 collect2:错误:ld 返回 1 个退出状态
- 编译问题:在函数"_start"中:未定义对"主"的引用 collect2:错误:ld 返回 1 个退出状态
- 试图在崇高中奔跑. 错误 已发生: 收集2.exe: 错误: ld 返回 1 退出状态
- collect2:错误:ld 返回 1 个退出状态未定义的引用
- C++ collect2:错误:ld 返回 1 退出状态
- 找不到 -llibmysqld Collect2.exe:错误:ld 返回 1 退出状态
- 每次我要使用外部资源时,我都会得到:collect2。exe:错误 ld 返回 1 退出状态
- 当出现错误ld return 1退出状态时,如何编译程序
- 无法访问 Arduino 结构字段。错误"退出状态 1。xxxx 不命名类型"
- "Extern"对象问题:错误:Id 返回 1 个退出状态
- c++ (C::B) 错误:ld 返回 1 个退出状态
- 在 c++ 中捕获 shell 脚本退出状态
- 对"displayForStudent(int, int const*, double const*, int)"的未定义引用 collect2.exe:错误:ld 返回 1 个退出状态
- 使用类[错误] LD返回1退出状态
- 如何解决退出状态 1 错误
- 错误 (Id) 返回 1 个退出状态
- 退出状态 1 令牌之前的预期主表达式'.'
- 错误:LD返回1个退出状态-CodeBlocks