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. Can't build any projet I get collect2:error:ld returned 1 exit status
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 1.9k 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.
  • F Offline
    F Offline
    featTheB
    wrote on last edited by featTheB
    #1

    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

    sierdzioS 1 Reply Last reply
    0
    • F 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

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @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
      4

      • Login

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