"/usr/bin/ld:找不到-lGL"在构建Qt应用程序时 [英] "/usr/bin/ld: cannot find -lGL" when building a Qt application

查看:72
本文介绍了"/usr/bin/ld:找不到-lGL"在构建Qt应用程序时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我昨天安装了Linux Debian,然后安装了最新的Qt版本.今天,我安装了gcc和g ++.但是问题是,当我创建GUI应用程序时,它不会构建并运行.

I installed Linux Debian yesterday and then the latest Qt version. Today I installed gcc and g++. But the problem is, it doesn't build and run when I create a GUI Application.

每当我创建一个新项目时,选择gui甚至不更改任何未编译的项目,我都会收到此消息:

Whenever I create a new Project, select the gui and don't even change anything it doesn't compile and I get this message :

/usr/bin/ld:找不到-lGLcollect2:错误:ld返回1退出状态make: * [untitled]错误114:17:36:进程"/usr/bin/make"以代码2退出.生成/部署无标题项目时出错(工具包:Desktop Qt 5.1.1 GCC 64bit)执行步骤制作"

/usr/bin/ld: cannot find -lGL collect2: error: ld returned 1 exit status make: * [untitled] Error 1 14:17:36: The process "/usr/bin/make" exited with code 2. Error while building/deploying project untitled (kit: Desktop Qt 5.1.1 GCC 64bit) When executing step 'Make'

好像我缺少一个库,但是我不知道如何安装它.我什至不知道是哪一个.

Seems like I'm missing a library but I don't know how to install it. I don't even know which one it is.

有人可以帮助我吗?

推荐答案

尝试:

apt-get install libgl1-mesa-glx

apt-get install libgl1-mesa-glx

开发包实际上不是问题.您遇到的是链接器错误,而不是编译器错误.

The dev packages are actually not the problem. You have a linker error, not a compiler error.

根据您的图形卡,您可以使用专门的OpenGL实现,例如NVIDA卡之类的 libgl1-nvidia-glx 之类的东西.

Depending on your graphic card you might use specialized OpenGL implementation, e.g. something like libgl1-nvidia-glx fror NVIDA cards.

这篇关于"/usr/bin/ld:找不到-lGL"在构建Qt应用程序时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆