Installing Qt on linux, cannot find -lGL

前端 未结 5 1633
礼貌的吻别
礼貌的吻别 2020-12-30 21:07

I\'m having a hard time trying to install Qt on linux. I downloaded the .run file on the website and installed Qt. However, when I try to compile the default Hello World pro

相关标签:
5条回答
  • 2020-12-30 21:24

    Do you have libgl-dev installed? If not install it and it should work.

    0 讨论(0)
  • 2020-12-30 21:27

    Well it is trying to link with libgl and doesn't find it. You should install libgl-dev.

    -l is a linker option, it tells the linker to use a certain library. For example you can have -lmagic meaning that you want to use libmagic.

    Normally all libraries are called libsomething, and on debian you will find 3 packages called: libsomething libsomething-dbg libsomething-dev

    The 1st one is the library, the second one is the library compiled with the debug symbols, so you can make sense of stacktraces more easily, and the final one is the development package, it contains the .h files so you can link to the library.

    0 讨论(0)
  • 2020-12-30 21:38

    On Fedora 17, I did:

    sudo yum install mesa-libGL-devel
    
    0 讨论(0)
  • 2020-12-30 21:40

    sudo apt-get install libgl-dev

    0 讨论(0)
  • 2020-12-30 21:42

    Those other posters are correct, but on some systems, the lib to install is named differently. I just dealt with a 32bit Ubuntu 14.04.5 LTS system, and libgl-dev was not available.

    Instead, I needed to install the libgl1-mesa-dev package via:

    sudo apt-get install libgl1-mesa-dev
    
    0 讨论(0)
提交回复
热议问题