Qt 5.7 -lGL not found



  • Hi !

    I wanted to migrate my software from Qt 4.8 to 5.7, but I'm stopped by a message "-IGL not found" at the link stage.

    I'm working on linux.

    I don't understand which library is missing since under Qt 4.8 I don't have any error !

    Thanks 4 your help,

    BenoitH



  • It should be OpenGL library.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Please search the forum a bit, this question has been asked many times already: you are missing the OpenGL development package on your system.

    Then name of the package depends on your distribution.



  • I have the same problem .
    using Centos 7.2.1511 Core(x86-64) Cinnamon 2.8.8 (GCC) 4.8.5 20150623
    after have installed all components my Qt creator is still sending error messages about libGL . which libGL should I use ?

    /usr/bin/ld: skipping incompatible /usr/lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /lib/../lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib/../lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /lib/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib/libGL.so when searching for -lGL


  • Lifetime Qt Champion

    Hi,

    Did you install a 32 bit Qt in your system ?



  • @SGaist

    my version is qt-opensource-linux-x64-5.7.0


  • Lifetime Qt Champion

    Can you show the linker line before it starts outputting this error ?



  • 18:18:02: Running steps for project MyPrj...
    18:18:02: Starting: "/home/chrystielira/Qt5.7.0x/5.7/gcc_64/bin/qmake" /home/chrystielira/Desktop/CPP_projects/MyPrj/MyPrj.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
    Info: creating stash file /home/chrystielira/Desktop/CPP_projects/build-MyPrj-Desktop_Qt_5_7_0_GCC_64bit-Debug/.qmake.stash
    18:18:02: The process "/home/chrystielira/Qt5.7.0x/5.7/gcc_64/bin/qmake" exited normally.
    18:18:02: Starting: "/usr/bin/make"
    /home/chrystielira/Qt5.7.0x/5.7/gcc_64/bin/uic ../MyPrj/mainwindow.ui -o ui_mainwindow.h
    g++ -c -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../MyPrj -I. -I../../../Qt5.7.0x/5.7/gcc_64/include -I../../../Qt5.7.0x/5.7/gcc_64/include/QtWidgets -I../../../Qt5.7.0x/5.7/gcc_64/include/QtGui -I../../../Qt5.7.0x/5.7/gcc_64/include/QtCore -I. -I. -I../../../Qt5.7.0x/5.7/gcc_64/mkspecs/linux-g++ -o main.o ../MyPrj/main.cpp
    g++ -c -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../MyPrj -I. -I../../../Qt5.7.0x/5.7/gcc_64/include -I../../../Qt5.7.0x/5.7/gcc_64/include/QtWidgets -I../../../Qt5.7.0x/5.7/gcc_64/include/QtGui -I../../../Qt5.7.0x/5.7/gcc_64/include/QtCore -I. -I. -I../../../Qt5.7.0x/5.7/gcc_64/mkspecs/linux-g++ -o mainwindow.o ../MyPrj/mainwindow.cpp
    /home/chrystielira/Qt5.7.0x/5.7/gcc_64/bin/moc -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/home/chrystielira/Qt5.7.0x/5.7/gcc_64/mkspecs/linux-g++ -I/home/chrystielira/Desktop/CPP_projects/MyPrj -I/home/chrystielira/Qt5.7.0x/5.7/gcc_64/include -I/home/chrystielira/Qt5.7.0x/5.7/gcc_64/include/QtWidgets -I/home/chrystielira/Qt5.7.0x/5.7/gcc_64/include/QtGui -I/home/chrystielira/Qt5.7.0x/5.7/gcc_64/include/QtCore -I. -I/usr/include/c++/4.8.5 -I/usr/include/c++/4.8.5/x86_64-redhat-linux -I/usr/include/c++/4.8.5/backward -I/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include -I/usr/local/include -I/usr/include ../MyPrj/mainwindow.h -o moc_mainwindow.cpp
    g++ -c -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../MyPrj -I. -I../../../Qt5.7.0x/5.7/gcc_64/include -I../../../Qt5.7.0x/5.7/gcc_64/include/QtWidgets -I../../../Qt5.7.0x/5.7/gcc_64/include/QtGui -I../../../Qt5.7.0x/5.7/gcc_64/include/QtCore -I. -I. -I../../../Qt5.7.0x/5.7/gcc_64/mkspecs/linux-g++ -o moc_mainwindow.o moc_mainwindow.cpp
    g++ -Wl,-rpath,/home/chrystielira/Qt5.7.0x/5.7/gcc_64/lib -o MyPrj main.o mainwindow.o moc_mainwindow.o -L/home/chrystielira/Qt5.7.0x/5.7/gcc_64/lib -lQt5Widgets -L/usr/lib64 -lQt5Gui -lQt5Core -lGL -lpthread
    /usr/bin/ld: skipping incompatible /usr/lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /lib/../lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib/../lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib64/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /lib/libGL.so when searching for -lGL
    /usr/bin/ld: skipping incompatible /usr/lib/libGL.so when searching for -lGL
    /usr/bin/ld: cannot find -lGL
    collect2: error: ld returned 1 exit status
    make: *** [MyPrj] Error 1
    18:18:05: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project MyPrj (kit: Desktop Qt 5.7.0 GCC 64bit)
    When executing step "Make"
    18:18:05: Elapsed time: 00:03.


  • Lifetime Qt Champion

    Maybe a silly question but did you install the OpenGL dev package for your OS ?



  • @SGaist yes . unfortunately many times . but it doesn't works , and i don't have any clue of what is wrong in my system :( !!


  • Lifetime Qt Champion

    Strange, then one silly idea, install the Qt development environment from your distribution. That might trigger some additional packages installation that might help.



  • It seems you did not install libgl or installed but the link was broken.
    search libgl.so in your pi3 sysroot.


Log in to reply
 

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