Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. "/usr/bin/ld: cannot find -lGL" impossible to compile a Qt project
QtWS25 Last Chance

"/usr/bin/ld: cannot find -lGL" impossible to compile a Qt project

Scheduled Pinned Locked Moved Solved General and Desktop
16 Posts 7 Posters 4.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wotan
    wrote on 8 Jun 2018, 15:59 last edited by
    #1

    Since I bought a new computer (I installed Debian stretch with Qt 5.10.1), I can't anymore compile a Qt project. I always end on the following message : "/usr/bin/ld: cannot find -lGL"
    After going through many forum, I can already tell you that I already install libglapi-mesa, libgl1-mesa-dev, libgles1-mesa-dev and libgles2-mesa-dev, but I still end in the same compile error.

    Of course, if I delete -lGL from the Makefile I can compile but I would like to be able to include this library.

    As anyone an idea about what I am missing ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Jun 2018, 20:01 last edited by
      #2

      Hi,

      What Linux distribution are you running ?
      What architecture is it ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • W Offline
        W Offline
        Wotan
        wrote on 9 Jun 2018, 16:07 last edited by
        #3

        I am under Debian 9.4 and my architecture is x86_64.

        $ uname -a
        Linux VTK-industries-salon 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux
        

        Hope it helped !

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 9 Jun 2018, 20:23 last edited by
          #4

          How did you install Qt ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 9 Jun 2018, 22:49 last edited by
            #5

            Hi
            On ubuntu i had to do
            sudo apt-get install mesa-common-dev
            to get the actual headers.

            1 Reply Last reply
            1
            • W Offline
              W Offline
              Wotan
              wrote on 10 Jun 2018, 14:58 last edited by
              #6

              The package mesa-common-dev is already install on my computer.
              And I installed Qt trough the installer for linux qt-unified-linux-x64-3.0.4-online.run

              J 1 Reply Last reply 10 Jun 2018, 17:15
              0
              • W Wotan
                10 Jun 2018, 14:58

                The package mesa-common-dev is already install on my computer.
                And I installed Qt trough the installer for linux qt-unified-linux-x64-3.0.4-online.run

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 10 Jun 2018, 17:15 last edited by
                #7

                @Wotan See here: https://doc.qt.io/qt-5/linux.html
                You need to install

                sudo apt-get install build-essential libgl1-mesa-dev
                

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                M 1 Reply Last reply 14 Aug 2019, 04:43
                5
                • W Offline
                  W Offline
                  Wotan
                  wrote on 11 Jun 2018, 13:59 last edited by
                  #8

                  jsulm : it is already installed ...

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 11 Jun 2018, 22:00 last edited by
                    #9

                    What graphic stack do you have on your machine ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • W Offline
                      W Offline
                      Wotan
                      wrote on 12 Jun 2018, 12:16 last edited by
                      #10

                      SGaist : What do you mean ? What is a graphic stack ?

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 12 Jun 2018, 21:39 last edited by
                        #11

                        Graphics card, driver, etc.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • W Offline
                          W Offline
                          Wotan
                          wrote on 13 Jun 2018, 17:01 last edited by
                          #12

                          My graphic card is a "GeForce GTX 1060 6GB"
                          The driver I installed is "NVIDIA-Linux-x86_64-390.42.run"
                          I hope it helped ...

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 13 Jun 2018, 21:02 last edited by
                            #13

                            Did you check the related libraries ? Where are they installed ?

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • SifuS Offline
                              SifuS Offline
                              Sifu
                              wrote on 19 Jun 2018, 17:02 last edited by
                              #14

                              @Wotan said in "/usr/bin/ld: cannot find -lGL" impossible to compile a Qt project:

                              GL

                              Run the following command in shell and see if the libraries installed or not in your computer

                              ldconfig -v | grep -i GL

                              The library you are looking will be libGL.so . If it is not there install it as follows,

                              sudo apt-get install libgl1 -y

                              That will probably fix this issue.

                              1 Reply Last reply
                              2
                              • J jsulm
                                10 Jun 2018, 17:15

                                @Wotan See here: https://doc.qt.io/qt-5/linux.html
                                You need to install

                                sudo apt-get install build-essential libgl1-mesa-dev
                                
                                M Offline
                                M Offline
                                Monolith
                                wrote on 14 Aug 2019, 04:43 last edited by
                                #15

                                @jsulm Thanks your so much. Problem solved

                                Pablo J. RoginaP 1 Reply Last reply 14 Aug 2019, 13:51
                                0
                                • M Monolith
                                  14 Aug 2019, 04:43

                                  @jsulm Thanks your so much. Problem solved

                                  Pablo J. RoginaP Offline
                                  Pablo J. RoginaP Offline
                                  Pablo J. Rogina
                                  wrote on 14 Aug 2019, 13:51 last edited by
                                  #16

                                  @monolith said in "/usr/bin/ld: cannot find -lGL" impossible to compile a Qt project:

                                  Problem solved

                                  so please mark your post as such! Thanks.

                                  Upvote the answer(s) that helped you solve the issue
                                  Use "Topic Tools" button to mark your post as Solved
                                  Add screenshots via postimage.org
                                  Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                                  1 Reply Last reply
                                  1

                                  • Login

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Users
                                  • Groups
                                  • Search
                                  • Get Qt Extensions
                                  • Unsolved