Qt:找不到 -lGL 错误

2022-11-21C/C++开发问题
4

QtMQ=="> 本文介绍了Qt:找不到 -lGL 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我刚刚重新安装了 QtCreator,创建了新项目(Qt Application)并在编译后得到了这个:

I just reinstalled QtCreator, created new project (Qt Application) an got this after compilation:

/usr/bin/ld: **cannot find -lGL**
collect2: error: ld returned 1 exit status
make: *** [untitled1] Error 1
18:07:41: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project untitled1 (kit: Desktop Qt 5.1.0 GCC 32bit)
When executing step 'Make'

(项目是空的,我没有提交任何更改)

Qt Creator 2.7.2
基于 Qt 5.1.0(32 位)
Ubuntu 13.04

Qt Creator 2.7.2
Based on Qt 5.1.0 (32 bit)
Ubuntu 13.04

我该如何解决这个问题?

How do I solve this problem?

推荐答案

您应该安装包libgl1-mesa-dev":

You should install package "libgl1-mesa-dev":

sudo apt install libgl1-mesa-dev

这篇关于Qt:找不到 -lGL 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End
Qt

相关推荐

如何在 Qt 中实现 OpenSSL?
How to implement OpenSSL in Qt?(如何在 Qt 中实现 OpenSSL?)...
2024-08-14 C/C++开发问题
6

如何使用 MinGW 编译器和 SSL 支持静态编译 Qt
how to statically compile Qt using MinGW compiler and SSL support(如何使用 MinGW 编译器和 SSL 支持静态编译 Qt)...
2024-08-14 C/C++开发问题
6

Qt设置QLineEdit的背景颜色
Qt Set Background Color of QLineEdit(Qt设置QLineEdit的背景颜色)...
2024-08-13 C/C++开发问题
5

在 raspberry 中交叉编译的 qt 中构建应用程序时出错
Error while building app in cross-compiled qt in raspberry(在 raspberry 中交叉编译的 qt 中构建应用程序时出错)...
2023-12-03 C/C++开发问题
6

Qt Creator、ptrace:不允许操作.什么是永久解决方案?
Qt Creator, ptrace: Operation not permitted. What is the permanent solution?(Qt Creator、ptrace:不允许操作.什么是永久解决方案?)...
2023-12-03 C/C++开发问题
8

查找从未调用的函数
Find never-called functions(查找从未调用的函数)...
2023-12-03 C/C++开发问题
3