Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED] Simple Application not building: Cannot find -lGL
Forum Update on Monday, May 27th 2025

[SOLVED] Simple Application not building: Cannot find -lGL

Scheduled Pinned Locked Moved Installation and Deployment
7 Posts 2 Posters 2.3k 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.
  • P Offline
    P Offline
    polyform
    wrote on last edited by
    #1

    I'm new to Qt and currently using the Qt Creator on Linux Mint 15. Unfortunately I'm unable to open my "Hello World" application due to the following error:

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

    I've checked the Build & Run options and a kit is selected. There's no error there, but I can't run the program due to this apparently missing file or library. I tried googling this question first but no luck. I've also got the gcc gnu c and g++ gnu compilers installed.

    Would anybody know what I'm missing here? Thanks in advanced.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Don't search for "cannot find -lgl" but for "cannot find lgl" the minus sign negates the following word from the search pattern.

      This question has been asked on the forum many times for various linux flavor. You are missing the OpenGL development package.

      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
      • P Offline
        P Offline
        polyform
        wrote on last edited by
        #3

        Gaist, installing the OpenGL packages worked like a charm, and I'll keep in mind what you said about the minus sign. Thanks again.

        For those of you searching, I installed the packages like so:

        apt-get install freeglut3-dev

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

          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
          • P Offline
            P Offline
            polyform
            wrote on last edited by
            #5

            Sure, although I can't find where to change it. I did a search and according to other users, it's a mod only option. Let me know and I'll be happy to change it though. I'll stay subscribed to this thread in the meantime.

            Source:
            http://www.qtcentre.org/threads/31475-Mark-Thread-as-SOLVED

            [quote author="SGaist" date="1383594678"]You're welcome !

            Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)[/quote]

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Just edit your first post and update the thread title, that's all

              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
              • P Offline
                P Offline
                polyform
                wrote on last edited by
                #7

                Oops sorry :) Okay done!

                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