"Get Started With Qt" tutorial on TuxRadar - help

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

"Get Started With Qt" tutorial on TuxRadar - help

Postby Bruno » Mon Aug 01, 2011 2:17 pm

Hi All,

I've been following the "Create a Media Player" tutorial on http://www.tuxradar.com/learnqt and have run into a problem getting it to run. I get an error message "~/src/mediamangler/mainwindow.h:11: error: Phonon: No such file or directory"

I've done a search online, but there seems to be more heat than light surrounding this issue. What I think is happening is that Qt Creator cannot find the Phonon libraries and/or headers. Indeed the "#include <Phonon>" entry near the top of the "mainwindow.h" file has a wiggly yellow line underneath it (suggesting an error?). When I mousepointer-over the entry, the "Phonon: No such file or directory" message appears in blue near by. Other entries, like "#include <QList>" give a message of "/usr/include/QtCore/QList" in blue, an obvious directory path.

It looks like it is a simple matter of adding the path to Phonon in a config file somewhere but I'm stumped as to where to find it (or how to add the path it via Qt Creator). Any ideas please?

I'm using openSuSE 11.4, 64 bit, with Qt 4.7.1 and Qt Creator 2.1.0 on one machine and openSuSE 11.3, 32 bit, with Qt 4.6.3 and Qt Creator 1.3.1 on another machine, I have the same problem on both. The "phonon" and "phonon-devel" packages are present on both systems.

Many thanks in advance for your help,
Bruno
User avatar
Bruno
LXF regular
 
Posts: 139
Joined: Tue Sep 18, 2007 6:07 pm
Location: Cambridgeshire, UK

Not fixed but kludged

Postby Bruno » Tue Aug 02, 2011 5:45 pm

OK, at risk of looking like I'm bumping my post, perhaps the best place to try is the Qt forums before coming here. However, if anyone else is having the same problem, the following link contains some illumination http://www.qtforum.org/article/27656/phonon-mediaobject-no-such-file-or-directory.html#post95894.

By including the following code at the top of the "mainwindow.h" file:

Code: Select all
#include <Phonon/MediaObject>
#include <Phonon/AudioOutput>


and by installing the following links:

Code: Select all
ln -s /usr/include/phonon/ /usr/include/Phonon
ln -s /usr/include/phonon/ /usr/include/Qt/Phonon
ln -s /usr/include/phonon/ /usr/include/Qt/phonon


The app runs, success! But I don't understand why I need to specify every bit of Phonon that I use (#include <Phonon/MediaObject> etc) rather than just Phonon in general (#include <Phonon>). Despite adding the links, this still does not work.

TTFN, Bruno
User avatar
Bruno
LXF regular
 
Posts: 139
Joined: Tue Sep 18, 2007 6:07 pm
Location: Cambridgeshire, UK


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest