Reputation: 63
I am using ubuntu 11.10 and creating a GUI using QT that uses a cmakelist when building. The problem I am having is i get the "undefined reference to`Phonon::VideoPlayer::VideoPlayer(Phonon::Category, QWidget*)'" error when running make.
I am using QT 4.7.4 and this "Qt PHONON library not found." also appears when running make.
This is from the cMakeCache
//Path to a library. QT_PHONONWIDGETS_PLUGIN_RELEASE:FILEPATH=/usr/lib/i386-linux-gnu/qt4/plugins/designer/libphononwidgets.so
//Path to a file. QT_PHONON_INCLUDE_DIR:PATH=/usr/include/qt4/phonon
//The Qt PHONON library QT_PHONON_LIBRARY:STRING=
The string always remains empty.
In my header file this is the related code
include "phonon/VideoPlayer"
Phonon::VideoPlayer* player;
and in the cpp
player = new Phonon::VideoPlayer(Phonon::VideoCategory,this);
any help is appreciated.
Thanks
Jacob
Upvotes: 1
Views: 2715
Reputation: 516
If you are using linux install phonon and libphonon-dev: $sudo apt-get install phonon libphonon-dev
After you can include in your project.pro file:
LIBS += -lphonon
If doesn't works, you can certificate if the lib is installed: $locate libphonon.so
The output maybe is: "/usr/lib/i386-linux-gnu/libphonon.so"
you can include in your project.pro file: INCLUDEPATH += /usr/lib/i386-linux-gnu
LIBS += -lphonon
Upvotes: 0
Reputation: 63
I ended up having to copy the four libphonon.so files from QtSDK/QtCreator/lib/qtcreator to usr/lib/i386-linux-gnu to make it work.
Thanks for help :)
Upvotes: 1
Reputation: 81
Try this:
Use these header files:
#include <phonon/AudioOutput>
#include <phonon/MediaObject>
#include <phonon/MediaSource>
#include <phonon/VideoWidget>
#include <phonon/VideoPlayer>
using namespace Phonon;
And this is a simple example from the Qt's documentation:
VideoPlayer *player = new VideoPlayer(Phonon::VideoCategory, parentWidget);
connect(player, SIGNAL(finished()), player, SLOT(deleteLater()));
player->play(url);
Upvotes: 0