I have a problem building applications in Qt on Debian.
When I try to compile anything I get:
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
make: *** [test] Error 1
14:38:52: Proces "/usr/bin/make" zakończył się kodem wyjściowym 2.
Last line means: Procces(...)
exited with code: 2
Any idea what's wrong?
Since this is a linker error, you may have one of two problems:
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!
You need to install the relevant packages into your path to be able to link against it. Having only the headers right is not enough because that will only get you through the compilation, but not the linkage stage.
Just use your package manager because it will put you all this into the right path by default:
sudo apt-get install libgl1-mesa-dev
Also, note that in general if you had not had the headers installed either, just get rid of the dependency in your application because it means you do not really depend on the library, just formally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With