Important: Please read the Qt Code of Conduct -

Qt Creator error: /usr/lib/ld: cannot find -lGL

  • Qt Creator gives an error message: /usr/lib/ld: cannot find -lGL

    19:06:04: The steps for the 'Test' project are performed.
    19:06:04: The settings was not changed, stage qmake is skipped.
    19:06:04: Starting: «/usr/bin/make» -j2
    g++ -Wl,-rpath,/home/chelizomona/Programs/QtCreator/5.15.0/gcc_64/lib -o Test main.o mainwindow.o moc_mainwindow.o   /home/chelizomona/Programs/QtCreator/5.15.0/gcc_64/lib/ /home/chelizomona/Programs/QtCreator/5.15.0/gcc_64/lib/ /home/chelizomona/Programs/QtCreator/5.15.0/gcc_64/lib/ -lGL -lpthread   
    /usr/bin/ld: cannot find -lGL
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:247: Test] Error 1
    19:06:04: The process «/usr/bin/make» ended with code 2.
    Build/Deploy Error "Test" project (Kit: Desktop Qt 5.15.0 GCC 64bit)
    During the execution of the «Build»
    19:06:04: Time passed: 00:01.

    The package libgl1-mesa-dev is installed and the file in /usr/lib/, but Qt Creator doesn't see him((

    P.S.: Sorry for my English, i don't know him very well

  • Lifetime Qt Champion

    Hi and welcome to the forums

    What linux is it ?
    On newer ubuntu sometimes we need to use ln create a soft link
    the destan asnwer

    something like
    sudo ln -s /usr/lib/ /usr/lib/

    I hope its readable you :)

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You are still missing

    Depending on your version of Debian, you should also install libglvnd-dev.

Log in to reply