Installing Qt on linux, cannot find -lGL
installation, linux, qt
Solution
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.
Problem
I'm having a hard time trying to install Qt on linux. I downloaded the .run file on the website and installed Qt. However, when I try to compile the default Hello World project using Qtcreator, I get the following : ``` error cannot find -lGL ``` I was able to solve the problem by issuing the command : ``` sudo apt-get install libqt4-dev ``` But, I'm not satisfied with the solution as I want to use Qt5 and the name of the lib I downloaded implies version 4. Can someone explain what is going on and tell me if my solution is correct? If not, what should I do to get a working Qt on Linux. Additional question The correct answer, as provided by LtWorf, was to install libgl-dev. For future problems of this sort, can someone tell me how I should have guessed that I had to download this particular library? And why are there some libs with -dev at the end? What do they provide?