Installing Qt on linux, cannot find -lGL
Well it is trying to link with libgl and doesn't find it. You should install libgl-dev.
-l
is a linker option, it tells the linker to use a certain library.
For example you can have -lmagic
meaning that you want to use libmagic.
Normally all libraries are called libsomething, and on debian you will find 3 packages called:
libsomething
libsomething-dbg
libsomething-dev
The 1st one is the library, the second one is the library compiled with the debug symbols, so you can make sense of stacktraces more easily, and the final one is the development package, it contains the .h files so you can link to the library.
qt5: cannot find -lGL
Since I have seen this:
Cannot start '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
then the solution can be found here: cmake not working, could not exec qmake.
Qt: can't find -lGL error
You should install package "libgl1-mesa-dev":
sudo apt install libgl1-mesa-dev
Qt Creator compile error cannot find -lGL. Other solutions are not working
So what I found worked for me, I manual added the path to the library and compiled. Then I was able to remove the manually added path. I assume somewhere on the backend it was not searching the correct place and once it was shown it remembered and kept the correct location.
Qt debian/ubuntu: Can't compile, error: cannot find -lGL
Since this is a linker error, you may have one of two problems:
- You don't have libGL installed
- libGL is installed but not in your system path.
If libGL isn't installed, you can install it:
sudo apt-get install libgl1-mesa-dev
I think is the right package. I don't have a debian machine handy so I can't test it.
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/
.
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.
Good luck!
/usr/bin/ld: cannot find -lGL when building a Qt application
Try:
apt-get install libgl1-mesa-glx
The dev packages are actually not the problem. You have a linker error, not a compiler error.
Depending on your graphic card you might use specialized OpenGL implementation, e.g. something like libgl1-nvidia-glx
fror NVIDA cards.
Related Topics
What Is File Hole and How Can It Be Used
Setting Up a Subdomain with Apache on Linux
How to Split a Ca Certificate Bundle into Separate Files
How to Prefill Command Line Input
How to Echo a Sum of a Variable and a Number
Are There Some Program Like Com0Com in Linux
Error Running Make: Missing Separator (Did You Mean Tab Instead of 8 Spaces)
Bash Script: Difference in Minutes Between Two Times
Linux C/C++ Socket Send in Multi-Thread Code
How to Send Sigint (Ctrl-C) to Current Remote Process Over Ssh (Without -T Option)
Linux Join Utility Complains About Input File Not Being Sorted
How to Start Node.Js on Port 80 on a Linux Server
Sed: How to Delete Lines Matching a Pattern That Contains Forward Slashes