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. Ubuntu Linux 13.and Qt 5.3 "cannot find -lGL" and "-lglut" even though I installed them

Ubuntu Linux 13.and Qt 5.3 "cannot find -lGL" and "-lglut" even though I installed them

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 3.8k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    brebarth
    wrote on last edited by
    #1

    Ah, need a little help here.

    I'm a new to Linux and not exactly a wiz with Qt either.

    I've installed Ubuntu, and QtCreator with Qt 5.3.
    I've also installed OpenGL for development using
    sudo apt-get update
    sudo apt-get install mesa-common-dev
    sudo apt-get install build-essential

    When compiling my Qt Project, I get "cannot find -lGL" and "cannot find -lglut", even though I've added
    "QT += opengl"
    in my .pro file.

    any ideas where I'm missing something?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      brebarth
      wrote on last edited by
      #2

      That is Ubuntu 13.04

      1 Reply Last reply
      0
      • ZlatomirZ Offline
        ZlatomirZ Offline
        Zlatomir
        wrote on last edited by
        #3

        Install opengl: @sudo apt-get install libgl1-mesa-dev@ for glut i don't know the package name, but it should be easy to find with search.

        I too thought that mesa-common-dev installs gl, but it looks like it doesn't: "link":http://www.qtcentre.org/threads/57256-SOLVED-error-cannot-find-lGL

        LE: Also you might want to remove QT += opengl from the .pro file, that links to the "Qt OpenGl":http://qt-project.org/doc/qt-5/qtopengl-index.html module, don't forget to run qmake after you modify the .pro file (also i think this might add the need for glut, if you don't explicitly use glut in your code remove the module and see if you need to install glut too, as far as i remember opengl is enough)

        https://forum.qt.io/category/41/romanian

        1 Reply Last reply
        0
        • B Offline
          B Offline
          brebarth
          wrote on last edited by
          #4

          I installed
          @sudo apt-get install libgl1-mesa-dev@

          then I ran qmake, clean and rebuild.
          But I still get “cannot find -lGL”

          1 Reply Last reply
          0
          • B Offline
            B Offline
            brebarth
            wrote on last edited by
            #5

            for installing glut I followed these "instructions":http://kiwwito.com/installing-opengl-glut-libraries-in-ubuntu/
            particularly:
            @sudo apt-get install binutils-gold@

            Now I get this error

            @:-1: error: error: cannot open /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libGL.so: No such file or directory@

            and lots of undefined gl references ('glBlendFunc' etc...)
            I hope that's a step in the right direction..

            1 Reply Last reply
            0
            • B Offline
              B Offline
              brebarth
              wrote on last edited by
              #6

              I added

              @LIBS += -L/usr/lib/x86_64-linux-gnu/mesa -lGL@

              to the .pro file

              now I get

              @:-1: error: error: cannot open /usr/lib/x86_64-linux-gnu/mesa/libGL.so: No such file or directory@

              even though I've checked in the file browser and the file exists at specified location. Any ideas?

              1 Reply Last reply
              0
              • J Offline
                J Offline
                john_god
                wrote on last edited by
                #7

                Try:
                sudo apt-get install libqt5opengl5-dev

                1 Reply Last reply
                0

                • Login

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