Sumit Nangia
Sumit Nangia

Reputation: 1

Unable to get compiled code running due to "collect2: ld returned 1 exit status." error

This error is getting displayed after I build the code in compile output section.

C:\Qt\2009.04\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lphonond
collect2: ld returned 1 exit status.
mingw32-make[1]: *** [debug\addressbook.exe] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.
Error while building project addressbook
When executing build step 'Make'

Irrespective of any code I am building, I get this common one. I am using windows 7 and Qt 4.

Upvotes: 0

Views: 539

Answers (2)

JimR
JimR

Reputation: 16113

You need to give more details if you want more than passing help. The relevant pieces of the makefile would be a good start.

Figure out where libphonond is stored and pass the path to the linker with -L if the path is not already there.

It might be that:

  • The lib is not installed. If you built Qt from source, libphonond might not be part of the default build.
  • The lib is not configured for linking in the makefile correctly
  • You did not build all the debugging libs

There's a place to start anyway...

Upvotes: 0

mdup
mdup

Reputation: 8509

From http://www.qtcentre.org/wiki/index.php?title=Building_the_Phonon_backend_plugin_on_Windows_using_MinGW :

This article [Building the Phonon backend plugin on Windows using MinGW] is obsolete since version 4.6. Qt by default has phonon support now.

Looking at your build path, you seem to have a version older than 4.6 (which was released on 1 December 2009, whereas you have Qt as of April 2009.04).

In other words : get a newer version of Qt.

Upvotes: 0

Related Questions