Important: Please read the Qt Code of Conduct -

Build Error: cannot find -LGL on Ubuntu 14.04

  • I have just installed Qt 5.3.2 from "" file on my Ubuntu 14.04. But I can not build any Qt widget application / Qt Qucik application. Here is what Compile Output says:

    @06:57:19: Running steps for project hello...
    06:57:19: Configuration unchanged, skipping qmake step.
    06:57:19: Starting: "/usr/bin/make"
    g++ -Wl,-rpath,/home/sakib/Qt5.3.2/5.3/gcc -Wl,-rpath,/home/sakib/Qt5.3.2/5.3/gcc/lib -o hello main.o mainwindow.o moc_mainwindow.o -L/home/sakib/Qt5.3.2/5.3/gcc/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
    /usr/bin/ld: cannot find -lGL
    collect2: error: ld returned 1 exit status
    make: *** [hello] Error 1
    06:57:19: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project hello (kit: Desktop Qt 5.3 GCC 32bit)
    When executing step "Make"
    06:57:19: Elapsed time: 00:00.@

    Please help someone. Thanks in advance.

  • You need the opengl development package, to install it run this in terminal:
    @sudo apt-get install libgl1-mesa-dev@

  • Thanks Zlatomir, thanks a lot. Its functioning properly now. :)

  • @Zlatomir Thank you

Log in to reply