Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved Can't build any projet I get collect2:error:ld returned 1 exit status

    General and Desktop
    2
    2
    1421
    Loading More Posts
    • 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.
    • F
      featTheB last edited by featTheB

      Hi,

      I very new to qt and c++ programming. Every time i want to build my projet or any other projet i get this error

      collect2:error:ld returned 1 exit status

      when i click show output on the error I get this :

      g++ -Wl,-rpath,/home/myname/Qt/5.11.0/gcc_64/lib -o home_camera main.o mainwindow.o camera.o moc_mainwindow.o -L/usr/local/lib -lopencv_core -lopencv_imgcodecs -lopencv_highgui -lopencv_video -lopencv_videoio -L/home/myname/Qt/5.11.0/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
      /usr/bin/x86_64-linux-gnu-ld: cannot find -lGL
      collect2: error: ld returned 1 exit status
      Makefile:261: recipe for target 'home_camera' failed
      make: *** [home_camera] Error 1
      16:04:41: The process "/usr/bin/make" exited with code 2.
      Error while building/deploying project home_camera (kit: Desktop Qt 5.11.0 GCC 64bit)
      When executing step "Make"

      I try to reinstall QT and the problem still persist

      sierdzio 1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators @featTheB last edited by

        @featTheB said in Can't build any projet I get collect2:error:ld returned 1 exit status:

        usr/bin/x86_64-linux-gnu-ld: cannot find -lGL

        That is the issue - your linker can't find OpenGL drivers. Please install them.

        (Z(:^

        1 Reply Last reply Reply Quote 4
        • First post
          Last post