Results 1 to 10 of 10

Thread: collect2: ld returned 1 exit status

  1. #1
    Join Date
    May 2009
    Posts
    3
    Thanks
    1

    Default collect2: ld returned 1 exit status

    I have latest qt to a ubuntu system.I am taking this error collect2: ld returned 1 exit status
    in build issues and this in compile output

    /usr/bin/ld: cannot find -lfreetype
    collect2: ld returned 1 exit status
    make: *** [test] Error 1
    make: Leaving directory `/home/joe/QtProjects/test'
    Exited with code 2.
    Error while building project test
    When executing build step 'Make'


    any help to fix that problem i can't run qt in linux....please help me

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: collect2: ld returned 1 exit status

    What library paths did you specify?
    I'm a rebel in the S.D.G.

  3. #3
    Join Date
    May 2009
    Posts
    61
    Thanks
    5
    Thanked 6 Times in 6 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: collect2: ld returned 1 exit status

    ... and is freetype (or freetype-dev) installed at all?

  4. The following user says thank you to auba for this useful post:

    qtnewbie123 (17th May 2009)

  5. #4
    Join Date
    May 2009
    Posts
    3
    Thanks
    1

    Default Re: collect2: ld returned 1 exit status

    I have download this:
    Qt Code:
    1. http://www.qtsoftware.com/downloads/sdk-linux-x11-32bit-cpp
    To copy to clipboard, switch view to plain text mode 

    and i installed it in ubuntu 9.04.I did just a simple install.At first i had a problem with g++ so i did
    Qt Code:
    1. sudo apt-get install g++
    To copy to clipboard, switch view to plain text mode 

    Now i have this problem
    Qt Code:
    1. collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 

    In an other box i have installed the windows version which compiling correct

    What should i fix??

  6. #5
    Join Date
    May 2009
    Posts
    3
    Thanks
    1

    Default Re: collect2: ld returned 1 exit status

    I fixed the problem

    I had more errors like:
    Qt Code:
    1. /usr/bin/ld: cannot find -lfreetype ---> libfreetype from synaptic package manager
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. /usr/bin/ld: cannot find -lSM ---> libsm
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. /usr/bin/ld: cannot find -lXext ----> libxext
    To copy to clipboard, switch view to plain text mode 

    The solution for the other newbies like me who have the same problems is to install from synaptic package manager the correct libs.

  7. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: collect2: ld returned 1 exit status

    sudo apt-get install build-essential
    is always a good start...

  8. #7
    Join Date
    Dec 2010
    Posts
    71
    Thanks
    26
    Platforms
    Windows

    Default Re: collect2: ld returned 1 exit status

    What if the error is cannot find -lssl and ssl package is installed? and on /usr/lib there is a libssl.a ; libssl.so ; libssl.so.0.9.8 and libssl3.so

    The .so files only libssl3.so doesn't have the shortcut arrow on the icon.

    same thing happened to -ljpeg... and I have libjpeg installed too.

    What could be wrong?

  9. #8
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: collect2: ld returned 1 exit status

    Development libraries / packages are often marked as libwhatever-dev, so maybe try to install libjpeg-dev, or something like that.

  10. #9
    Join Date
    Dec 2010
    Posts
    71
    Thanks
    26
    Platforms
    Windows

    Default Re: collect2: ld returned 1 exit status

    Quote Originally Posted by stampede View Post
    Development libraries / packages are often marked as libwhatever-dev, so maybe try to install libjpeg-dev, or something like that.
    It is already installed... every libjpeg or libssl related package is installed... except for libjpeg62-dev as libjpeg8-dev is installed... but I also tried with 62 and still same error...

  11. #10
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: collect2: ld returned 1 exit status

    Can you post the compilation command ? Make sure that you specify correct path for the linker with -L"path to lib" switch

Similar Threads

  1. Collect2:Id Returned 1 exit status
    By c_srikanth1984 in forum Qt Programming
    Replies: 9
    Last Post: 14th February 2010, 05:58
  2. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 07:13
  3. ld returned 1 exit status.....An unsual error
    By shamik in forum Qt Programming
    Replies: 4
    Last Post: 23rd November 2006, 11:14

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.