Linking error: cannot find -lGL



  • Hi,

    I installed Qt 5.3.1 using the linux 64 bit online installer on Ubuntu 14.04 to my home directory. I tried to create a new project using File->New File or Project, selecting Qt Quick Application, and clicking next a few times. Then, when I try to build it using the green play button I get the following error:

    @g++ -Wl,-rpath,/home/waspinator/Qt/5.3/gcc_64 -Wl,-rpath,/home/waspinator/Qt/5.3/gcc_64/lib -o qt_test main.o qrc_qml.o -L/home/waspinator/Qt/5.3/gcc_64/lib -lQt5Quick -lQt5Qml -lQt5Widgets -lQt5Network -lQt5Gui -lQt5Core -lGL -lpthread
    /usr/bin/ld: cannot find -lGL
    collect2: error: ld returned 1 exit status
    make: *** [qt_test] Error 1
    12:20:12: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project qt_test (kit: Desktop Qt 5.3 GCC 64bit)
    When executing step 'Make'@

    I tried to find libGL but only have libGLSL

    @$ locate libGL
    /home/waspinator/Qt/Tools/QtCreator/lib/qtcreator/libGLSL.so
    /home/waspinator/Qt/Tools/QtCreator/lib/qtcreator/libGLSL.so.1
    /home/waspinator/Qt/Tools/QtCreator/lib/qtcreator/libGLSL.so.1.0
    /home/waspinator/Qt/Tools/QtCreator/lib/qtcreator/libGLSL.so.1.0.0
    /home/waspinator/Qt/Tools/QtCreator/lib/qtcreator/plugins/QtProject/libGLSLEditor.so
    /usr/lib/x86_64-linux-gnu/libGLEW.so.1.10
    /usr/lib/x86_64-linux-gnu/libGLEW.so.1.10.0
    /usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.10
    /usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.10.0
    /usr/lib/x86_64-linux-gnu/libGLU.so.1
    /usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1
    /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
    /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
    /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2
    /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2.0.0@

    Did I miss a step during installation?


  • Moderators

    Hi, and welcome to the Qt Dev Net!

    This is a common question: http://qt-project.org/forums/viewthread/36399



  • oh. thanks.


Log in to reply
 

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