Important: Please read the Qt Code of Conduct -

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/../../../ when searching for -lGL

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

    :-1: error: skipping incompatible /usr/lib/ 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.

  • Lifetime Qt Champion

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

    file /lib/
    file /usr/lib/

    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/
    /usr/lib/ symbolic link to `'

    [root@nelson bin]# file /usr/lib/
    /usr/lib/ symbolic link to `'

  • following the chain...

    [root@nelson bin]# file /usr/lib/
    /usr/lib/ symbolic link to `'

    file /usr/lib/
    /usr/lib/ 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

  • Lifetime Qt Champion

    @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

    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/../../../ when searching for -lGL

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

  • Lifetime Qt Champion

    @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,


Log in to reply