Qt debian/ubuntu: Can#39;t compile, error: cannot find -lGL(Qt debian/ubuntu:无法编译,错误:找不到-lGL)
问题描述
我在 Debian 上使用 Qt 构建应用程序时遇到问题.
I have a problem building applications in Qt on Debian.
当我尝试编译我得到的任何东西时:
When I try to compile anything I get:
/usr/bin/ld: 找不到 -lGLcollect2:错误:ld 返回 1 个退出状态make: *** [测试] 错误 114:38:52:处理/usr/bin/make" zakończył się kodem wyjściowym 2.
最后一行的意思是:Procces(...) exited with code: 2
Last line means: Procces(...) exited with code: 2
知道有什么问题吗?
推荐答案
由于这是链接器错误,您可能会遇到以下两个问题之一:
Since this is a linker error, you may have one of two problems:
- 您没有安装 libGL
- libGL 已安装,但不在您的系统路径中.
如果没有安装libGL,你可以安装它:
If libGL isn't installed, you can install it:
sudo apt-get install libgl1-mesa-dev
我认为是正确的包装.我手边没有debian机器,所以无法测试.
I think is the right package. I don't have a debian machine handy so I can't test it.
如果你安装了这个包,你需要把它添加到你的系统路径中.您需要将其附加到环境变量 LD_LIBRARY_PATH 或在 /etc/ld.so.conf.d/.conf 文件>.
If you have this package installed, you need to add it to your system path. You'll need to append it to environment variable LD_LIBRARY_PATH or make a .conf file located in /etc/ld.so.conf.d/.
同样,我没有 debian 机器来验证这些路径,但这是我能从记忆中做的最好的事情.无论哪种方式,这应该是足够的信息开始.
Again, I don't have a debian machine to verify these paths, but that's the best I can do from memory. Either way, this should be enough information to get started.
祝你好运!
这篇关于Qt debian/ubuntu:无法编译,错误:找不到-lGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Qt debian/ubuntu:无法编译,错误:找不到-lGL
基础教程推荐
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- CString 到 char* 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 初始化列表*参数*评估顺序 2021-01-01
