"/usr/bin/ld: cannot find -lGL" impossible to compile a Qt project
-
Since I bought a new computer (I installed Debian stretch with Qt 5.10.1), I can't anymore compile a Qt project. I always end on the following message : "/usr/bin/ld: cannot find -lGL"
After going through many forum, I can already tell you that I already install libglapi-mesa, libgl1-mesa-dev, libgles1-mesa-dev and libgles2-mesa-dev, but I still end in the same compile error.Of course, if I delete -lGL from the Makefile I can compile but I would like to be able to include this library.
As anyone an idea about what I am missing ?
-
Hi,
What Linux distribution are you running ?
What architecture is it ? -
How did you install Qt ?
-
Hi
On ubuntu i had to do
sudo apt-get install mesa-common-dev
to get the actual headers. -
The package mesa-common-dev is already install on my computer.
And I installed Qt trough the installer for linux qt-unified-linux-x64-3.0.4-online.run@Wotan See here: https://doc.qt.io/qt-5/linux.html
You need to installsudo apt-get install build-essential libgl1-mesa-dev
-
What graphic stack do you have on your machine ?
-
Graphics card, driver, etc.
-
Did you check the related libraries ? Where are they installed ?
-
@Wotan said in "/usr/bin/ld: cannot find -lGL" impossible to compile a Qt project:
GL
Run the following command in shell and see if the libraries installed or not in your computer
ldconfig -v | grep -i GL
The library you are looking will be libGL.so . If it is not there install it as follows,
sudo apt-get install libgl1 -y
That will probably fix this issue.
-
@Wotan See here: https://doc.qt.io/qt-5/linux.html
You need to installsudo apt-get install build-essential libgl1-mesa-dev
-
@monolith said in "/usr/bin/ld: cannot find -lGL" impossible to compile a Qt project:
Problem solved
so please mark your post as such! Thanks.