Qt on CentOS 7 not working



  • Dear all,
    I have installed Qt Creator on a CentOS 7 machine but whenever I try to build a program, even the examples one I get the following errors:

    :-1: error: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so when searching for -lGL

    :-1: error: skipping incompatible /lib/libGL.so when searching for -lGL

    :-1: error: skipping incompatible /usr/lib/libGL.so when searching for -lGL

    :-1: error: cannot find -lGL

    :-1: error: collect2: error: ld returned 1 exit status

    Can you please help? It is driving me mad.


  • Moderators

    @Dino What is the exact Qt version (not QtCreator!) you installed? Is it x86?
    Also, you should execute

    file /lib/libGL.so
    file /usr/lib/libGL.so
    

    and post the output here. It looks like you're mixing x86 and x86_64.



  • First of all, thank you for your help, jsulm.

    This is the version I have installed: qt-opensource-linux-x64-5.9.0

    And the following is the output requested:

    [root@nelson bin]# file /usr/lib/libGL.so
    /usr/lib/libGL.so: symbolic link to `libGL.so.1'

    [root@nelson bin]# file /usr/lib/libGL.so
    /usr/lib/libGL.so: symbolic link to `libGL.so.1'



  • following the chain...

    [root@nelson bin]# file /usr/lib/libGL.so.1
    /usr/lib/libGL.so.1: symbolic link to `libGL.so.1.0.0'

    file /usr/lib/libGL.so.1.0.0
    /usr/lib/libGL.so.1.0.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped

    indeed is look like I am mixing 32-bit and 64-bit but I do not know how to fix the problem. I am a novice on using Qt and CentOS 7


  • Moderators

    @Dino You need to install the x64 OpenGL packages.



  • Dear jsulm,

    I have listed installed packages and find out I have already the right OpenGL installed:

    mesa-dri-drivers.x86_64 11.2.2-2.20160614.el7 @base
    mesa-filesystem.x86_64 11.2.2-2.20160614.el7 @base
    mesa-libEGL.i686 11.2.2-2.20160614.el7 @base
    mesa-libEGL.x86_64 11.2.2-2.20160614.el7 @base
    mesa-libEGL-devel.x86_64 11.2.2-2.20160614.el7 @base
    mesa-libGL.x86_64 11.2.2-2.20160614.el7 @base
    mesa-libGL-devel.x86_64 11.2.2-2.20160614.el7 @base
    mesa-libGLES.x86_64 11.2.2-2.20160614.el7 @base
    mesa-libGLU.x86_64 9.0.0-4.el7 @anaconda
    mesa-libGLU-devel.x86_64 9.0.0-4.el7 @base
    mesa-libgbm.i686 11.2.2-2.20160614.el7 @base
    mesa-libgbm.x86_64 11.2.2-2.20160614.el7 @base
    mesa-libglapi.x86_64 11.2.2-2.20160614.el7 @base
    mesa-libxatracker.x86_64 11.2.2-2.20160614.el7 @base
    mesa-private-llvm.x86_64

    I have removed the 32-bit ones that also were in the system but I still get the compiler error. It looks like is skipping the files refusing to use them:

    :-1: error: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so when searching for -lGL

    Is there a way to 'force' Qt to use them?


  • Moderators

    @Dino Qt is not the problem here.
    Where are the x86_64 OpenGL libs located?



  • Dear jsulm,

    In the end, it was indeed a mess with 32-bit and 64-bit libraries.

    To fix my problems I have to uninstall all version of Qt on my machine and all OpenGL libraries. Then I have installed the latest version of Qt and the mesa-libGL-devel-11.2.2-2.20160614.el7.x86_64.rpm package.

    Again thank you for your help.

    Kind Regards,

    Dino


Log in to reply
 

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