tags:

views:

929

answers:

2

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' 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 /home/varun/qtsdk-2009.03/qt/examples/phonon/musicplayer' 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! :)

+1  A: 

Is the phonon library compiled?

The library also depends on the platform media framework, which I think is gstreamer in your case.

Windows requires that you use Visual Studio, you cannot use Mingw32.

On windows, before you compile Qt what does the "configure" application output with regard to phonon.

The same with linux.

Phil Hannent
I have installed SDK from .sh installer available on qtsoftware.comI have libphonon4 package installed as well as gstreamer package installed.There is one package libqt4-phonon which I cannot install die to unresolved dependencies.I am using Ubuntu 9.04
varunmagical
+1  A: 

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.

BlackAura
I have installed from the downloaded sdk.. (not by compiling the source)
varunmagical
What is the ideal way to install qt?I am afraid of compiling from the source .. when I try under windows, compilation never succeeds!.. In linux, I am having success rate of near 5% for any compilation!I am new to Qt I dont know anything about it but I really want to learn it .. I have a lot of patience but I just want to see atleast all the demos working!
varunmagical
On Linux, the ideal way is using a distribution's package manager. In Ubuntu, for example, you can install libqt4-dev and libphonon-dev. On Windows, the downloadable SDK doesn't support Phonon, so you must compile Qt yourself if that's what you want.
BlackAura