Important: Please read the 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
    sudo apt-get install libgl1-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