Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

error: cannot find -lGL [SOLVED]



  • Hi all,

    I installed Ubuntu 15.04 amd64 to my virtual machine and qt from the web site's linux online installer..

    I get some errors but I corrected by intalling mesa-dev packages.. then..
    when I create a new qt widgets application or a qtwidgets sample the compiler always says

    : error: cannot find -lGL
    : error: collect2: error: ld returned 1 exit status

    what's wrong I googled this but I cannot find a solution ??



  • I also encountered the problem. you just run the flowing orders:
    sudo apt-get install libqt4-dev
    or
    sudo apt-get install libgl1-mesa-dev
    or
    libgl1-mesa-dev
    libglu1-mesa-dev
    because your Ubuntu lack of the files.



  • Thanks a lot... after installing libgl1-mesa-dev and libglu1 problem solved...

    Do you recommend any other things to install to my system not to have this king of problems?



  • @zeroptr
    Not to worry, because of the different systems, we will be missing a different file, when encountering problems, first step search internet, if no solution is found, and then ask.


Log in to reply