I am trying to compile media player sample application in qt 4.5 sdk using qtcreator.
I cannot compile them in windows as well as linux, in case of linux, this is the error:
Starting: /home/varun/qtsdk-2009.03/qt/bin/qmake /home/varun/qtsdk-2009.03/qt/examples/phonon/musicplayer/musicplayer.pro -spec linux-g++ -r
Exited with code 0.
Starting: /usr/bin/make -w
make: Entering directory /home/varun/qtsdk-2009.03/qt/examples/phonon/musicplayer'/home/varun/qtsdk-2009.03/qt/examples/phonon/musicplayer’
g++ -Wl,-O1 -Wl,-rpath,/home/varun/qtsdk-2009.03/qt/lib -o musicplayer main.o mainwindow.o moc_mainwindow.o -L/home/varun/qtsdk-2009.03/qt/lib -lphonon -lQtGui -L/home/varun/qtsdk-2009.03/qt/lib -L/usr/X11R6/lib -pthread -lfreetype -lgobject-2.0 -lSM -lICE -pthread -pthread -lXrender -lfontconfig -lXext -lX11 -lQtCore -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
/usr/bin/ld: cannot find -lphonon
collect2: ld returned 1 exit status
make: *** [musicplayer] Error 1
make: Leaving directory
Exited with code 2.
Error while building project musicplayer
When executing build step ‘Make’
In case of windows, missing thing is lphonond, rest error message is same
I am trying to build multimedia encoder in Qt, please help me resolve this error! 🙂
If you compiled Qt yourself, you probably didn’t include Phonon.
On Linux, you have to add “-phonon” to your configure line, and you probably also need development libraries for whatever back-end you want to build. Most likely, that will be GStreamer.
Unless you have a particular need to compile Qt from source code, you probably shouldn’t. The Qt development libraries that come with most recent Linux distributions should have Phonon support already built-in, with an appropriate back-end set up.
On Windows, you can’t build Phonon with a stock version of MinGW – you need to upgrade to GCC 4.4, and apply some patches.
You can also build Qt using Microsoft’s compilers. Either the Windows SDK or Visual Studio Express Edition will do the trick, as will a full version of Visual Studio if you have it. You also need the DirectX SDK. If you’re using Qt Creator, you will probably also have to compile that from source.