Qt World Summit: Register Today!

[Solved]Qt 5.2.0 and -lGL issue.

  • Qt Champions 2017

    I installed Qt 5.2.0 on ubuntu 12.04 LTS. When I try to compile my first program, I see the following error

    bq. mainwindow.o moc_mainwindow.o -L/opt/Qt5.2.0/5.2.0/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
    /usr/bin/ld: cannot find -lGL
    collect2: error: ld returned 1 exit status

    I'm sure it is telling -GL module not found. Which is this module ? OpenGL ?. I continue to troubleshoot this issue. If somebody had fixed this, please do let me know. It will save my time :)

  • Moderators

    You have missing dependencies, most probably Mesa or proprietary OpenGL drivers. Check out the "build guide":http://qt-project.org/wiki/Building_Qt_5_from_Git for Ubuntu, there are detailed instructions about what needs to be installed.

  • Qt Champions 2017

    Thank you. This solved my problem.

  • Just in case someone runs into the same problem and wonders what to install.

    I have started out with a fresh Ubuntu 13.10 install on VirtualBox and ran into the same problem after I had installed the pre-build of Qt 5.2.0 with Qt creator.

    In my case the libxcb was apparently missing. However, I have installed ICU first, but this did not solve the problem. Therefore, I have started these commands in a terminal:
    sudo apt-get install libicu-dev
    sudo apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev