Cannot find -lGL

  • I have an error, which says "cannot find -lGL". I'm tryung to install QT on Ubuntu 14.04 everything is ok, but when I want to Build a GUI application I get this error, I surfed the internet for a day and could not find anything. Can someone help me?

  • Hi and welcome.
    You need to install dev-packages

    sudo apt-get install libgl1-mesa-dev

    Sometimes this helps

    sudo apt-get install libglu1-mesa-dev -y

  • Moderators

    Usually it's already there. Just needs a symlink:

    locate //locate the lib, in my case it's /usr/lib/x86-64-linux-gnu/mesa/
    sudo ln -s /usr/lib/x86-64-linux-gnu/mesa/ /usr/lib/

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Installing the libgl1-mesa-dev package is the correct solution. libGL's location can change depending on whether you are using a 32 or 64 bit version of Ubuntu.

    Note that this question has already been asked many times on this forum, you should search without the minus before lGL.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.