PDA

View Full Version : error: cannot find -lGL



CodeFreak
29th July 2018, 19:37
Hi everyone,
I've installed Qt 5.11.1 on Ubuntu.
I tried to run an empty widget, but following error occurred:

error: cannot find -lGL
:confused:

d_stranz
30th July 2018, 00:47
I tried to run an empty widget

You don't run widgets, you run compiled and linked executable programs. The linker is complaining because you have asked it to link to an OpenGL library but you either 1) don't have an OpenGL development environment installed, 2) you have not specified the correct path the to OpenGL libraries in your Makefile / qmake .pro file or 3) the library is not named libGL on your system. And once you solve this problem, it will probably complain about the glu library as well since most OpenGL programs also use glu.

Based on the questions you are posting here, I think you are in a bit over your head. Why don't you start by building some of the example programs that come with Qt and then once you get those to build and run correctly you can move on to programs of your own.