Results 1 to 9 of 9

Thread: error: collect2: ld returned 1 exit status while implementing a simple signal/slot

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: error: collect2: ld returned 1 exit status while implementing a simple signal/slo

    here it is the compiler output, i dont understand the error message...
    and if i remove the Q_OBJECT macro it builds correctly, but signals doesnt work
    Attached Images Attached Images

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: error: collect2: ld returned 1 exit status while implementing a simple signal/slo

    Yes, that error message means a missing moc, see my post above.

    Q_OBJECT is required for signals to function.

    Did you run qmake?

  3. #3
    Join Date
    Apr 2011
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: error: collect2: ld returned 1 exit status while implementing a simple signal/slo

    hello, thanks for replying, i dont know so much about qmake command, but i right clicked on project name and picked run qmake, and it just told me that process exited normally, i rebuilded the project and i got the same error

  4. #4
    Join Date
    Apr 2011
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: error: collect2: ld returned 1 exit status while implementing a simple signal/slo

    any suggestion please?

  5. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: error: collect2: ld returned 1 exit status while implementing a simple signal/slo

    You could post your complete output log so we can see if the moc files are being compiled and linked.

    Or you could post your code in an archived format and we can see if we can replicate the problem.

  6. #6
    Join Date
    Apr 2011
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: error: collect2: ld returned 1 exit status while implementing a simple signal/slo

    well, thanks everyone for replying... i don't know what happened, but i just copied the .h and .cpp files, then i added them to a new project and it builds correctly and signals work ok, i don't know why and how but i works hahahaah
    thanks anyway

Similar Threads

  1. error: collect2: ld returned 1 exit status
    By Splatify in forum Newbie
    Replies: 2
    Last Post: 13th February 2011, 18:09
  2. Replies: 7
    Last Post: 10th February 2011, 23:35
  3. error: collect2: ld returned 1 exit status
    By srohit24 in forum Qt Programming
    Replies: 3
    Last Post: 1st December 2009, 06:32
  4. error: collect2: ld returned 1 exit status
    By nataly in forum Qt Programming
    Replies: 4
    Last Post: 13th October 2009, 13:39
  5. collect2: ld returned 1 exit status error
    By gmsk19 in forum Qt Tools
    Replies: 11
    Last Post: 25th July 2009, 02: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
  •  
Qt is a trademark of The Qt Company.