D
D
Deretor2014-06-03 23:11:38
Qt
Deretor, 2014-06-03 23:11:38

QT in Ubuntu: How to fix a bug? :-1: error: cannot find -lGL?

Full text of the error
:-1: error: cannot find -lGL
:-1: error: collect2: error: ld returned 1 exit status
Qt creator downloaded from app center.
OS: Ubuntu 13.10

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
RPG, 2014-06-04
@RPG

You most likely don't have the developer pack for the OpenGL library. Install the mesa-common-dev package.

sudo apt-get install mesa-common-dev
sudo apt-get install freeglut3-dev

PS Such advice is useful for any library when something is not linked.

P
polden, 2015-10-02
@polden

most likely, Qt cannot find the OpenGL library (I don’t know why it needs it to compile a freshly created pristine project in my case)
, first you can see what the symlink refers to:

  • forcibly link any of the found files in the format
    sudo ln -s -f /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
     /usr/lib/libGL.so

    PS: the advice may not be so good, but it was this sequence of actions that helped me in solving a similar problem

  • E
    Egorithm, 2020-01-17
    @EgoRusMarch

    I found a solution to this problem on Stack Overflow:
    sudo apt install libgl1-mesa-dev

    Didn't find what you were looking for?

    Ask your question

    Ask a Question

    731 491 924 answers to any question