Results 1 to 1 of 1

Thread: Playing MP3 with Qt/Phonon libs

  1. #1
    Join Date
    Mar 2012
    Posts
    12
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Playing MP3 with Qt/Phonon libs

    Hi there,

    I've been trying to play MP3 files using simply:

    Qt Code:
    1. Phonon::MediaObject *music =
    2. Phonon::createPlayer(Phonon::MusicCategory,
    3. Phonon::MediaSource("file.mp3"));
    4. music->play();
    To copy to clipboard, switch view to plain text mode 

    I'm getting these linker errors:

    Qt Code:
    1. 1>app.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Phonon::MediaObject::play(void)" (__imp_?play@MediaObject@Phonon@@QAEXXZ) referenced in function "public: __thiscall app::app(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0app@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z)
    2. 1>app.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Phonon::MediaSource::~MediaSource(void)" (__imp_??1MediaSource@Phonon@@QAE@XZ) referenced in function "public: __thiscall app::app(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0app@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z)
    3. 1>app.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class Phonon::MediaObject * __cdecl Phonon::createPlayer(enum Phonon::Category,class Phonon::MediaSource const &)" (__imp_?createPlayer@Phonon@@YAPAVMediaObject@1@W4Category@1@ABVMediaSource@1@@Z) referenced in function "public: __thiscall app::app(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0app@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z)
    4. 1>app.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Phonon::MediaSource::MediaSource(class QString const &)" (__imp_??0MediaSource@Phonon@@QAE@ABVQString@@@Z) referenced in function "public: __thiscall app::app(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0app@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z)
    To copy to clipboard, switch view to plain text mode 

    When I try to build the Phonon example applications that come with the Qt source, I cannot build the capabilities example. The qmusicplayer is compiled but does not really opens the audio files, returning the following message:
    Qt Code:
    1. WARNING: bool __thiscall Phonon::FactoryPrivate::createBackend(void) phonon backend plugin could not be loaded
    To copy to clipboard, switch view to plain text mode 

    I've built Qt static with MSVC2010. Do you have any idea why is this happening?
    Do you recommend any other way to play MP3 using other libs or something else...?

    Thanks for your help.
    Last edited by tcampos; 9th May 2012 at 13:59.

Similar Threads

  1. Playing an audio file with phonon
    By epaduel in forum Newbie
    Replies: 5
    Last Post: 31st January 2012, 01:48
  2. can't get o/p by playing mp3 file in Phonon
    By dibyendu in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2011, 13:09
  3. Playing only some channels with Phonon
    By jfrousval in forum Qt Programming
    Replies: 0
    Last Post: 10th March 2009, 13:30
  4. Playing a stream using phonon module
    By ram136682 in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 28th August 2008, 14:42
  5. Phonon video not playing
    By SidGBF in forum Qt Programming
    Replies: 2
    Last Post: 11th July 2008, 15:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.