Qt Build Errors - Linux Mint 17.3



  • Linux noob here, I have been attempting to install QT Creator. Whenever I build a program I get two errors:
    "cannot find -lGL" and "collect2: error: ld returned 1 exit status".

    Computer Stats
    OS: Linux Mint 17.3 Rosa, Xfce 64-bit
    Graphics Card: Nvidia Quadro M1000M (Linux Mint hasn't liked this so far)

    Solutions Attempted

    • Installed 3.0 through Software Manager (called qtcreator). It appeared to install correctly, but the examples were not visible and the build errors appeared.
    • Installed 5.4-5.6 through the Qt website. Now the examples show up, but I still get the two errors when I try to build anything.
    • @ sudo apt-get install libglu1-mesa-dev libx11-xcb-dev build-essential @
      --> The response is that these packages are already at the newest version.
    • @ sudo apt-get install libxrender-dev @
      --> Installed, but no improvement.
    • @ sudo apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev @
      --> The nuclear option. Still no improvement.

    Right now I'm at the end of my rope. I've researched these errors and nothing works. At this point I'm sure it's something silly that I've looked over. Can someone help me out?

    Edit: I should also mention there were a few errors when I installed Qt Creator the second time, all of them were similar to:
    "Error during installation process (qt.55.qtwebengine.gcc_64):
    Could not find the needed
    QmakeOutputInstallerKey(qt.55.gcc_64_qmakeoutput) value on the installer
    object. The ConsumeOutput operation on the valid qmake needs to be
    called first."

    SOLUTION
    There must have been an issue when I was installing the Nvidia driver the first time around. I have reinstalled the driver (NVIDIA 361.42) and Qt is no longer giving me that build error.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What exact error(s) did you have ?



  • @SGaist

    Hi SGaist, my two errors are:
    "cannot find -lGL" and "collect2: error: ld returned 1 exit status"

    These occur whenever I try to build a program in Qt Creator.


  • Lifetime Qt Champion

    That's the big classic (and often answered on this forum): you don't have the OpenGL dev package installed.



  • @SGaist

    I thought about that and tried reinstalling OpenGL per the instructions here: http://www.wikihow.com/Install-Mesa-(OpenGL)-on-Linux-Mint

    Unfortunately the issue persists.
    Here is the output when I run the line @glxinfo | grep OpenGL@
    OpenGL vendor string: NVIDIA Corporation
    OpenGL renderer string: Quadro M1000M/PCIe/SSE2
    OpenGL core profile version string: 4.3.0 NVIDIA 361.42
    OpenGL core profile shading language version string: 4.30 NVIDIA via Cg compiler
    OpenGL core profile context flags: (none)
    OpenGL core profile profile mask: core profile
    OpenGL core profile extensions:
    OpenGL version string: 4.5.0 NVIDIA 361.42
    OpenGL shading language version string: 4.50 NVIDIA
    OpenGL context flags: (none)
    OpenGL profile mask: (none)
    OpenGL extensions:

    From this it looks like OpenGL is installed correctly? Is that not the case?


  • Lifetime Qt Champion

    OpenGL yes, but double check the development packages, that's what seems to be missing.



  • @SGaist

    I'm inexperienced in this department. How can I check the development packages?


  • Lifetime Qt Champion

    Check that you have libglu1-mesa-dev installed. Calling apt-get install libglu1-mesa-dev should be enough.


  • Moderators

    @QUser9001 said:

    Computer Stats
    OS: Linux Mint 17.3 Rosa, Xfce 64-bit
    Graphics Card: Nvidia Quadro M1000M (Linux Mint hasn't liked this so far)

    Solutions Attempted
    ...

    • @ sudo apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev @
      --> The nuclear option. Still no improvement.

    Interesting... In all the other cases where I've seen the "cannot find -lGL" error message, installing libglu1-mesa-dev resolved the issue. Perhaps try rebooting your computer...?

    You mentioned that Linux Mint doesn't like your graphics card. What do you mean by that?



  • @SGaist

    Thank you for all the help. I reinstalled the driver (NVIDIA 361.42) and success! Qt is now working! There must have been a hidden issue with the driver installation.

    @JKSH

    To expand, I guess Mint has a history of issues with NViDIA drivers? When I was installing Mint originally, I would get a black screen and had to do a work-around in several different ways until I could get to the point where I could install the driver I needed. Since then I've come across little issues here and there that had to do with the driver. I'm sure it's not a big deal to most Linux users, but for a new Linux user it's been a little daunting.


Log in to reply
 

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