Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Qt cannot find libGL

  1. #1
    Join Date
    Nov 2013
    Location
    Canadiana
    Posts
    461

    Default Qt cannot find libGL

    I am attempting to learn Qt and am attempting to use the QGraphicsView but when I compile I get this error:
    Code:
    :-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
    I searched around and it seems to have something to do with 64bit/32bit packages, I have gcc which is 64bit and I installed mesa-devel which I assume is also 64bit. The only 32bit thing I can think of is perhaps the 32 bit libraries the nvidia installer asks to add tot he system (which I said yes to). Any guidance would be appreciated.

    ps: It is probably some simple problem but its 3 am here so I am feeling a bit tired, hopefully when I wake up someone will have left the answer to my problem here
    openSUSE Leap (42.1) 64 bit
    Plasma 5.4

  2. #2

    Default Re: Qt cannot find libGL

    For -lGL you need to install Mesa-libGL-devel.

    But, according to your error message:
    Quote Originally Posted by alanbortu View Post
    Code:
    :-1: error: skipping incompatible /usr/lib/libGL.so when searching for -lGL
    you seem to have the i586 version of Mesa-libGL-devel installed. This won't work!
    You need to install the x86_64 version.

    Use "rpm -q Mesa-libGL-devel" to check, or the "Versions" tab in YaST.

    If you want to build a 32bit application, you should additionally install Mesa-libGL-devel-32bit, this is co-installable with the 64bit Mesa-libGL-devel.

  3. #3
    Join Date
    Nov 2013
    Location
    Canadiana
    Posts
    461

    Default Re: Qt cannot find libGL

    Quote Originally Posted by wolfi323 View Post
    For -lGL you need to install Mesa-libGL-devel.

    But, according to your error message:

    you seem to have the i586 version of Mesa-libGL-devel installed. This won't work!
    You need to install the x86_64 version.

    Use "rpm -q Mesa-libGL-devel" to check, or the "Versions" tab in YaST.

    If you want to build a 32bit application, you should additionally install Mesa-libGL-devel-32bit, this is co-installable with the 64bit Mesa-libGL-devel.
    Code:
    ~> rpm -q Mesa-libGL-devel
    Mesa-libGL-devel-9.2.3-61.9.1.x86_64
    ~> rpm -q gcc 
    gcc-4.8-2.1.2.x86_64
    Strange, does that mean its trying to compile for 32 bit systems? I dont recall changing any settings related to that.

    I installed the 32 bit version of the devel package and now I get this:
    Code:
    :-1: error: cannot find -lGL
    :-1: error: collect2: error: ld returned 1 exit status
    So there was some progress...
    openSUSE Leap (42.1) 64 bit
    Plasma 5.4

  4. #4

    Default Re: Qt cannot find libGL

    Quote Originally Posted by alanbortu View Post
    Strange, does that mean its trying to compile for 32 bit systems? I dont recall changing any settings related to that.

    I installed the 32 bit version of the devel package and now I get this:
    Code:
    :-1: error: cannot find -lGL
    :-1: error: collect2: error: ld returned 1 exit status
    So there was some progress...
    How exactly are you trying to compile that application?
    It seems like your linker path is set wrong.

    But I still find it strange that you would get "skipping incompatible /usr/lib/libGL.so when searching for -lGL" when /usr/lib/libGL.so isn't installed, but "cannot find -lGL" when it is...

  5. #5
    Join Date
    Nov 2013
    Location
    Canadiana
    Posts
    461

    Default Re: Qt cannot find libGL

    Quote Originally Posted by wolfi323 View Post
    How exactly are you trying to compile that application?
    It seems like your linker path is set wrong.

    But I still find it strange that you would get "skipping incompatible /usr/lib/libGL.so when searching for -lGL" when /usr/lib/libGL.so isn't installed, but "cannot find -lGL" when it is...
    I am using Qt Creator, so whatever its default settings are for the kits, thats what I am using.

    Something interesting here though

    Code:
    ~> ll /usr/lib/libGL.so
    lrwxrwxrwx 1 root root 14 Apr 28 14:53 /usr/lib/libGL.so -> libGL.so.1.2.0
    
    ~> ll /usr/lib/libGL.so.1.2.0
    ls: cannot access /usr/lib/libGL.so.1.2.0: No such file or directory
    
    ~> ldd /usr/bin/glxgears
            linux-vdso.so.1 (0x00007fff00dfe000)
            libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007fbe9302f000)
            libm.so.6 => /lib64/libm.so.6 (0x00007fbe92d2c000)
            libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007fbe929ee000)
            libc.so.6 => /lib64/libc.so.6 (0x00007fbe9263f000)
            libnvidia-tls.so.331.67 => /usr/lib64/tls/libnvidia-tls.so.331.67 (0x00007fbe9243c000)
            libnvidia-glcore.so.331.67 => /usr/lib64/libnvidia-glcore.so.331.67 (0x00007fbe8fc2d000)
            libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007fbe8fa1b000)
            libdl.so.2 => /lib64/libdl.so.2 (0x00007fbe8f817000)
            libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fbe8f5f8000)
            /lib64/ld-linux-x86-64.so.2 (0x00007fbe93362000)
            libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fbe8f3f4000)
    openSUSE Leap (42.1) 64 bit
    Plasma 5.4

  6. #6

    Default Re: Qt cannot find libGL

    Quote Originally Posted by alanbortu View Post
    I am using Qt Creator, so whatever its default settings are for the kits, thats what I am using.
    Are you compiling one of the examples?
    This shouldn't be compiled as 32bit application then on a 64bit system with the default settings.

    Where did you install Qt Creator from though?
    Is it the one included in openSUSE?

    Something interesting here though

    Code:
    ~> ll /usr/lib/libGL.so
    lrwxrwxrwx 1 root root 14 Apr 28 14:53 /usr/lib/libGL.so -> libGL.so.1.2.0
    
    ~> ll /usr/lib/libGL.so.1.2.0
    ls: cannot access /usr/lib/libGL.so.1.2.0: No such file or directory
    OK, that explains why /usr/lib/libGL.so wasn't found.

    You need to install Mesa-libGL-32bit as well.
    But I thought that should be installed automatically if it was required...

  7. #7
    Join Date
    Nov 2013
    Location
    Canadiana
    Posts
    461

    Default Re: Qt cannot find libGL

    Quote Originally Posted by wolfi323 View Post
    Are you compiling one of the examples?
    This shouldn't be compiled as 32bit application then on a 64bit system with the default settings.

    Where did you install Qt Creator from though?
    Is it the one included in openSUSE?
    Its just some tutorial I am following, nothing complicated.
    I initially attempted to install qtcreator from the repos but that was causing issues so i just downloaded and installed it from the qt community site.

    Quote Originally Posted by wolfi323 View Post
    OK, that explains why /usr/lib/libGL.so wasn't found.

    You need to install Mesa-libGL-32bit as well.
    But I thought that should be installed automatically if it was required...
    There is no such package as Mesa-libGL-32bit
    Code:
    > se Mesa-libGL1-32bit  
    Loading repository data...
    Reading installed packages...
    
    S | Name              | Type    | Version      | Arch   | Repository          
    --+-------------------+---------+--------------+--------+---------------------
    i | Mesa-libGL1-32bit | package | 9.2.3-61.9.1 | x86_64 | openSUSE-13.1-Update
    v | Mesa-libGL1-32bit | package | 9.2.2-61.6.1 | x86_64 | openSUSE-13.1-Oss   
    
    
    ~> se Mesa-libGL-devel
    Loading repository data...
    Reading installed packages...
    
    S | Name                   | Type    | Version      | Arch   | Repository          
    --+------------------------+---------+--------------+--------+---------------------
    i | Mesa-libGL-devel       | package | 9.2.3-61.9.1 | x86_64 | openSUSE-13.1-Update
    v | Mesa-libGL-devel       | package | 9.2.2-61.6.1 | x86_64 | openSUSE-13.1-Oss   
    v | Mesa-libGL-devel       | package | 9.2.3-61.9.1 | i586   | openSUSE-13.1-Update
    v | Mesa-libGL-devel       | package | 9.2.2-61.6.1 | i586   | openSUSE-13.1-Oss   
    i | Mesa-libGL-devel-32bit | package | 9.2.3-61.9.1 | x86_64 | openSUSE-13.1-Update
    v | Mesa-libGL-devel-32bit | package | 9.2.2-61.6.1 | x86_64 | openSUSE-13.1-Oss
    I think the problem is the broken link.
    openSUSE Leap (42.1) 64 bit
    Plasma 5.4

  8. #8

    Default Re: Qt cannot find libGL

    Quote Originally Posted by alanbortu View Post
    Its just some tutorial I am following, nothing complicated.
    I initially attempted to install qtcreator from the repos but that was causing issues so i just downloaded and installed it from the qt community site.
    And what kind of issues?
    It worked fine here whenever I used it.

    I suppose that the version you installed has a wrong default linker path, i.e. just /usr/lib/ and not /usr/lib64/ as used on openSUSE-64bit.

    There is no such package as Mesa-libGL-32bit
    Sorry, that was a typo.
    I meant Mesa-libGL1-32bit of course, but you have that installed anyway.

    I think the problem is the broken link.
    Yes it is, if you wanted to compile for 32bit. But for doing that you would also need to specify some additional compiler flags.

    To fix the broken link, you should try to re-install "Mesa-libGL1-32bit":
    Code:
    sudo zypper in -f Mesa-libGL1-32bit
    This is what should contain /usr/lib/libGL.so.1.2.0.

    But your real problem is the wrong linker path I think.
    Where do you actually have "qmake" installed from?
    Code:
    rpm -qif `which qmake`
    Qt-Creator's qmake settings should look like this: (click on "Details")


    Maybe "QT_INSTALL_LIBS" is set to /usr/lib in your case? Try to change all of them to the values above, those are the defaults of the openSUSE package.
    Last edited by wolfi323; 28-Apr-2014 at 13:13.

  9. #9
    Join Date
    Nov 2013
    Location
    Canadiana
    Posts
    461

    Default Re: Qt cannot find libGL

    It seems the issue stems from the nvidia driver. I removed it and now I can compile the program just fine.

    Thank you for the help wolfi
    openSUSE Leap (42.1) 64 bit
    Plasma 5.4

  10. #10

    Default Re: Qt cannot find libGL

    Quote Originally Posted by alanbortu View Post
    It seems the issue stems from the nvidia driver. I removed it and now I can compile the program just fine.
    Oh.
    I did have this in mind at first, but then I really thought you should be able to compile libGL applications with the nvidia driver installed.
    Hm.
    As I don't have an nvidia system, I cannot really help you there, sorry.

    But another question. How did you actually install the nvidia driver?
    If it was by "the hard way", it just overwrites libGL with its own version, so that might explain it.
    Last edited by wolfi323; 28-Apr-2014 at 13:22.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •