tags:

views:

797

answers:

1

Hello everyone,

I get the following error when building a project in Qt Creator:

**error: collect2: ld returned 1 exit status**

Below is the compile output

**Running build steps for project mw_fe...**

Starting: F:/Qt/2009.04/qt/bin/qmake.exe C:/Documents and Settings/Administrator/My Documents/mw_fe/mw_fe.pro -spec win32-g++ -r CONFIG+=release 
Exited with code 0.
Starting: F:/Qt/2009.04/mingw/bin/mingw32-make.exe -w 
mingw32-make: Entering directory `C:/Documents and Settings/Administrator/My Documents/mw_fe'
F:/Qt/2009.04/mingw/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Documents and Settings/Administrator/My Documents/mw_fe'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,console -o release\mw_fe.exe release/main.o release/mamewah.o release/moc_mamewah.o -L"f:\Qt\2009.04\qt\lib" -lQtDBus -lQtTest4 -lQtScript4 -lQtXmlPatterns4 -lQtXml4 -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `C:/Documents and Settings/Administrator/My Documents/mw_fe'
mingw32-make: Leaving directory `C:/Documents and Settings/Administrator/My Documents/mw_fe'
f:\Qt\2009.04\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lQtDBus
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\mw_fe.exe] Error 1
mingw32-make: *** [release] Error 2
Exited with code 2.
Error while building project mw_fe
When executing build step 'Make'

Please help me...

Thanks.

+2  A: 

cannot find -lQtDBus

The QtDBus module is a Unix-only library. In theory it's possible to compile winDBus and then QtDBus for Windows. But it's not easy and I'm not sure about MinGW...

kemiisto
Bingo. The fix is to remove the dbus module from the .pro file. Open it and either remove `dbus` from the `QT +=` line, or add another line reading `QT -= dbus` to the file. kemiisto, could you perhaps edit your answer to include this info?
Mihai Limbășan
@ Mihai Limbasan But what if the project really needs QtDBus?
kemiisto
Great thanks to all of you...problem solved...
MA1
@kemiisto: Then it's broken anyway, at the moment there's no reasonable way to get the win32 port of dbus (which is badly outdated) to work with QtDBus...
Mihai Limbășan