PDA

View Full Version : problem with phonon/music player example.



rishiraj
21st January 2009, 11:30
Hi,
I was trying to run the 'musicplayer' example which uses phonon framework.I got a long list of errors(pasted below).I guess either phonon itself isn't present(though it's supposed to be bundled with Qt 4.4 and I am using Qt 4.4.3 on Linux (fedora) or maybe there's some other problem which you could help me in solving.
I didn't make any changes in the code.

Please advice on what to do?I am new to both Qt and Linux so please don't mind if my questions sound odd or too simple :)

Thanks for any help.
**********************************errors********** **************************
In file included from main.cpp:22:
mainwindow.h:25:37: error: phonon/phononnamespace.h: No such file or directory
mainwindow.h:26:33: error: phonon/audiooutput.h: No such file or directory
mainwindow.h:27:32: error: phonon/seekslider.h: No such file or directory
mainwindow.h:28:33: error: phonon/mediaobject.h: No such file or directory
mainwindow.h:29:34: error: phonon/volumeslider.h: No such file or directory
mainwindow.h:30:41: error: phonon/backendcapabilities.h: No such file or directory
mainwindow.h:52: error: ‘Phonon’ has not been declared
mainwindow.h:52: error: expected ‘,’ or ‘...’ before ‘newState’
mainwindow.h:54: error: expected ‘,’ or ‘...’ before ‘::’ token
mainwindow.h:54: error: ISO C++ forbids declaration of ‘Phonon’ with no type
mainwindow.h:55: error: ‘Phonon’ has not been declared
mainwindow.h:55: error: expected ‘,’ or ‘...’ before ‘newState’
mainwindow.h:64: error: ‘Phonon’ has not been declared
mainwindow.h:64: error: ISO C++ forbids declaration of ‘SeekSlider’ with no type
mainwindow.h:64: error: expected ‘;’ before ‘*’ token
mainwindow.h:65: error: ‘Phonon’ has not been declared
mainwindow.h:65: error: ISO C++ forbids declaration of ‘MediaObject’ with no type
mainwindow.h:65: error: expected ‘;’ before ‘*’ token
mainwindow.h:66: error: ‘Phonon’ has not been declared
mainwindow.h:66: error: ISO C++ forbids declaration of ‘MediaObject’ with no type
mainwindow.h:66: error: expected ‘;’ before ‘*’ token
mainwindow.h:67: error: ‘Phonon’ has not been declared
mainwindow.h:67: error: ISO C++ forbids declaration of ‘AudioOutput’ with no type
mainwindow.h:67: error: expected ‘;’ before ‘*’ token
mainwindow.h:68: error: ‘Phonon’ has not been declared
mainwindow.h:68: error: ISO C++ forbids declaration of ‘VolumeSlider’ with no type
mainwindow.h:68: error: expected ‘;’ before ‘*’ token
mainwindow.h:69: error: ‘Phonon’ was not declared in this scope
mainwindow.h:69: error: template argument 1 is invalid
make: *** [main.o] Error 1

rishiraj
21st January 2009, 11:37
My gcc version is 4.1.2 20070925 (Red Hat 4.1.2-33).
I guess it's not a compiler problem then as we need a minimum of 4.1.2 for phonon,right.Please let me know what I should do to get the music player working.
Thanks.

rishiraj
21st January 2009, 11:45
***UPDATE****
This is what I get when I traverse to /usr/local/Trolltech/Qt-4.4.3/include

[root@localhost Qt-4.4.3]# cd include
[root@localhost include]# ls
Qt QtAssistant QtDesigner QtHelp QtOpenGL QtSql QtTest QtWebKit QtXmlPatterns
Qt3Support QtCore QtGui QtNetwork QtScript QtSvg QtUiTools QtXml.

Can't see phonon anywhere :p
Please advice.
Thanks in advance .

rishiraj
22nd January 2009, 04:32
Still awaiting help?please advice on how to proceed.I am stuck on the music player.

radek.z
22nd January 2009, 13:45
Hi,
did you put QT += phonon in your .pro file?

radek

radek.z
22nd January 2009, 13:49
also try to check if you have the phonon directory in /usr/include

radek

rishiraj
23rd January 2009, 05:01
Hi,
First of all,thanks for replying.
Yes,the .pro file has QT +=phonon and no,I couldn't find 'phonon' anywhere in /usr/local/Trolltech/Qt-4.4.3.
I got a reply from the qt-mailing list saying that Qt installation wasn't correct so phonon headers are missing.

Is it possible to download 'phonon' package from somewhere and use it with the present Qt setup I got...without reinstalling Qt.
Thanks for your time.

radek.z
23rd January 2009, 06:44
Hi,
I don't think, that you can download some package for phonon. But I am not sure.
So I guess you should install it again. See the ./configure --help to check out how you can include phonon module. I think that it is included by default, but anyway do it just to be sure.
I did it by myself and it started to work. But for some reason the phonon appeare in /user/include directory while Qt is in /usr/local/Trolltech directory.

radek

rishiraj
23rd January 2009, 07:00
Hi,
thanks for the suggestion.I guess I will have to reinstall it again.Also,I didn't know that phonon shows in the usr/include.I was searching for it in the Qt folder.Thanks for enlightening me on that one.

radek.z
23rd January 2009, 08:00
Hi,
hopefully it will work for you.
I also didnt know phonon is in other directory.


so, best luck then

radek