PDA

View Full Version : Qt Creator fail to compile !



qt_chan
15th March 2010, 08:10
I've just install Qt Creator 1.3.1 from this Qt website
http://qt.nokia.com/downloads/qt-creator-binary-for-windows
I'm using Windows 7 64 bit. I followed the Qt Creator Manual to create a GUI application, however; it did not compiled successfully. I got these error messages from the compiler output:


Running build steps for project example...
Starting: c:/qt/2010.02.1/qt/bin/qmake.exe C:/Users/chan/Desktop/Qt4/example/example.pro -spec win32-g++ -r
Exited with code 0.
Starting: C:/Qt/2010.02.1/mingw/bin/mingw32-make.exe -w
mingw32-make: Entering directory `C:/Users/chan/Desktop/Qt4/example'
C:/Qt/2010.02.1/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/chan/Desktop/Qt4/example'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,console -o debug\example.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -L"c:\Qt\2010.02.1\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lQtDBusd -lQtTestd4 -lQtOpenGLd4 -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `C:/Users/chan/Desktop/Qt4/example'
mingw32-make: Leaving directory `C:/Users/chan/Desktop/Qt4/example'
c:/qt/2010.02.1/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lQtDBusd
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\example.exe] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.
Error while building project example
When executing build step 'Make'
And I have no idea what's wrong :( ! Anyone could give me a hint that where did I miss ? Thank you !

high_flyer
15th March 2010, 08:32
c:/qt/2010.02.1/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lQtDBusd
It looks like your Qt is not configured with QtDBus module.
This project needs the DBus modules to run.

qt_chan
15th March 2010, 16:36
Thanks high_flyer ! Can you show me how to configure QtDBus module ? I'm very newbie with GUI programming :) !

wysota
15th March 2010, 17:30
Where did you take this example from?

qt_chan
15th March 2010, 20:48
Example is the name of my project. I've just created a "Qt4 Gui Application" and click compiled button( which looked like a "play" button ). I did not modify anything from the code that given by Qt Creator.
I have 1 header file named "mainwindow.h" and 2 source files named "mainwindow.cpp" and "main.cpp" plus a mainwindow.ui.

Lykurg
15th March 2010, 21:00
Go to your *.pro file and delete dbus out ot the QT variable. Then rerun qmake and build again.

qt_chan
16th March 2010, 02:44
Thanks Lykurg ! It worked perfectly. And would you mind explaining why do I have to delete that "dbus" out of the QT variable ?

Lykurg
16th March 2010, 09:28
The right question is: Why do you have put it there if you don't need it? With the QT variable you define which (Qt-)libraries Qt should link against your application. So if you don't need a library or if you don't have such a library don't write it there.

qt_chan
17th March 2010, 06:41
Thanks for making it clear.