Question

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

Was it helpful?

Solution

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 :)

OTHER TIPS

Try this:

  1. From the ubuntu software center install phonon and libphonon-dev.
  2. After that add this to your project file (.pro) -> QT += phonon
  3. 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);

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top