Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt error: cannot find -lGL



  • Hi, I'm trying to make a QWidget for a university project, and I started from the most basic stuff following qt's official tutorials. However I' m encountering a compile problem: I keep getting this error:

    /usr/bin/ld: cannot find -lGL
    Makefile:251: recipe for target 'Test1' failed
    collect2: error: ld returned 1 exit status
    make: *** [Test1] Error 1
    00:05:55: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project Test1 (kit: Desktop Qt 5.10.0 GCC 64bit)
    The kit Desktop Qt 5.10.0 GCC 64bit has configuration issues which might be the root cause for this problem.
    When executing step "Make"

    Any suggestion?
    OS: Debian Stretch 9.5
    Kernek: 4.9.0-6-amd64
    Qt Creator 4.5.0
    Based on Qt 5.10.0 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)
    Built on Dec 4 2017 04:11:21

    0_1535494097131_Screenshot from 2018-08-29 00-07-45.png


  • Lifetime Qt Champion

    @mhetac said in Qt error: cannot find -lGL:

    : cannot find -lGL

    Hi and welcome to the forums
    can you try
    sudo apt-get install mesa-common-dev
    sudo apt-get install libglu1-mesa-dev -y
    https://wiki.qt.io/Install_Qt_5_on_Ubuntu

    maybe it has slightly differnt names on debian.
    it seems to miss the gl libs/headers



  • That actually worked, thanks a lot


Log in to reply