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 - Error when compile : 1: error: cannot find -lGL 2: ld returned 1 exit status
Forum Updated to NodeBB v4.3 + New Features

SOLVED - Error when compile : 1: error: cannot find -lGL 2: ld returned 1 exit status

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

    I have a simple program for testing the istallation of Creator, but when i compile the program,
    lauch this message and can't run. i work on xubuntu

    1: error: cannot find -lGL
    2: ld returned 1 exit status

    on screen compile output:

    15:10:14: Running steps for project test3...
    15:10:14: Configuration unchanged, skipping qmake step.
    15:10:14: Starting: "/usr/bin/make"
    g++ -Wl,-rpath,/home/lucho/Qt5.1.0/5.1.0/gcc_64 -Wl,-rpath,/home/lucho/Qt5.1.0/5.1.0/gcc_64/lib -o test3 main.o widget.o moc_widget.o -L/home/lucho/Qt5.1.0//5.1.0/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
    /usr/bin/ld: cannot find -lGL
    collect2: ld returned 1 exit status
    make: *** [test3] Error 1
    15:10:15: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project test3 (kit: Kit_lucho)
    When executing step 'Make'
    15:10:15: Elapsed time: 00:00.

    And this message is the first intent to compile, whit another kit (default) (the same simple program):

    15:45:03: Running steps for project test2...
    15:45:03: Configuration unchanged, skipping qmake step.
    15:45:03: Starting: "/usr/bin/make"
    g++ -Wl,-O1 -Wl,-rpath,/home/lucho/Qt5.1.0/5.1.0/gcc_64 -Wl,-rpath,/home/lucho/Qt5.1.0/5.1.0/gcc_64/lib -o test2 main.o widget.o moc_widget.o -L/home/lucho/Qt5.1.0//5.1.0/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
    /usr/bin/ld: cannot find -lGL
    collect2: ld returned 1 exit status
    make: *** [test2] Error 1
    15:45:03: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project test2 (kit: Desktop Qt 5.1.0 GCC 64bit)
    When executing step 'Make'
    15:45:03: Elapsed time: 00:00.

    Thanks in advance for help me

    Luis

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

      Hi,

      You are missing the opengl dev files

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

        Hello SGaist:
        Can you tell me how to install thats files and first where find it.
        I work on Xubuntu

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

          Did you try to search this forum a bit ?
          This question as already come up several times on the forum (xubuntu is just a derivative of ubuntu)

          Anyway have a look "here":http://qt-project.org/wiki/Building_Qt_5_from_Git even if you don't build Qt yourself the information is valid

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

            Thanks a lot SGaist; I couid solve the problem.
            Only, I have installed the opengl dev files on my computer, and now all is ok.
            I can do my firsts qt programs.

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

              You're welcome !

              Please update the thread's 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

              • Login

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