Results 1 to 2 of 2

Thread: collect2: error: ld returned 1 exit status

  1. #1
    Join Date
    Jul 2010
    Location
    TN
    Posts
    10
    Thanks
    2
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows Android

    Question collect2: error: ld returned 1 exit status

    Good morning,

    I am having issues with the above error when trying to compile the app I am working on. I have the full error below, but just want to give a little background. I am running a fresh install of Ubuntu 18.04, Gnome Desktop, 4gb memory, Core i5 processor. This error is basically immediate, I create a new project and name it. Once creator opens the files for editing I don't do anything but save and then select the option to build. Soon as I do that I get the following....

    Qt Code:
    1. moc_mainwindow.o moc_mainwindow.cpp
    2. g++ -Wl,-rpath,/home/david/Qt/5.11.1/gcc_64/lib -o SimpleNote main.o mainwindow.o moc_mainwindow.o -L/home/david/Qt/5.11.1/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
    3. /usr/bin/x86_64-linux-gnu-ld: cannot find -lGL
    4. Makefile:257: recipe for target 'SimpleNote' failed
    5. collect2: error: ld returned 1 exit status
    6. make: *** [SimpleNote] Error 1
    7. 09:32:20: The process "/usr/bin/make" exited with code 2.
    8. Error while building/deploying project SimpleNote (kit: Desktop Qt 5.11.1 GCC 64bit)
    9. When executing step "Make"
    To copy to clipboard, switch view to plain text mode 

    I have not changed or added anything to the project as of yet. Just fresh creation of a new project and then build/run. Any ideas on what may be causing the problem? I didn't have this issue when I was running Kubuntu or Manjaro.

    Many thanks

  2. #2
    Join Date
    Jul 2010
    Location
    TN
    Posts
    10
    Thanks
    2
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows Android

    Default Re: collect2: error: ld returned 1 exit status

    Found the fix already, listing it below...

    If running ubuntu have to install

    Qt Code:
    1. sudo apt-get install libgl-dev libglu-dev
    To copy to clipboard, switch view to plain text mode 

    and possibly..

    Qt Code:
    1. sudo apt-get install libglib2.0-dev libSM-dev libxrender-dev libfontconfig1-dev libxext-dev
    To copy to clipboard, switch view to plain text mode 

    After doing this my app now builds fine.

    Actually found this information in QT Creator under help section > FAQ.

    Hope this helps others as well

Similar Threads

  1. error: collect2: ld returned 1 exit status
    By Splatify in forum Newbie
    Replies: 2
    Last Post: 13th February 2011, 19:09
  2. Replies: 7
    Last Post: 11th February 2011, 00:35
  3. error: collect2: ld returned 1 exit status
    By srohit24 in forum Qt Programming
    Replies: 3
    Last Post: 1st December 2009, 07:32
  4. error: collect2: ld returned 1 exit status
    By nataly in forum Qt Programming
    Replies: 4
    Last Post: 13th October 2009, 14:39
  5. collect2: ld returned 1 exit status error
    By gmsk19 in forum Qt Tools
    Replies: 11
    Last Post: 25th July 2009, 03:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.