Results 1 to 16 of 16

Thread: Phonon linking problem

  1. #1
    Join Date
    Aug 2010
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Phonon linking problem

    Hello, I seem to be having a bit of a problem using phonon as well as QSound:lay();

    When I try to use QSound:lay();, the only sound I get is the windows error beep(ding), so I decided to use Phonon instead, even though I'm fairly certain it's a bit more resource intensive to use two instances of Phonon (one for media play back and one for environment sound effects to replace QSound). However, I am now having problems with Phonon as well.

    I followed to example for Phonon included with the Qt SDK, included all that I needed for phonon, and added the QT += phonon to my project file. Still, I am having undefined reference errors when I try to compile. It doesn't seem that Phonon is being linked to my project properly, am I missing something?

    Qt Code:
    1. debug/***.o:D:\Projects\***-build-desktop/../***/***.cpp:28: undefined reference to `_imp___ZN6Phonon11MediaSourceC1ERK7QString'
    2. debug/***.o:D:\Projects\***-build-desktop/../***/***.cpp:28: undefined reference to `_imp___ZN6Phonon11MediaObject16setCurrentSourceERKNS_11MediaSourceE'
    3. debug/***.o:D:\Projects\***-build-desktop/../***/***.cpp:28: undefined reference to `_imp___ZN6Phonon11MediaSourceD1Ev'
    4. debug/***.o:D:\Projects\***-build-desktop/../***/***.cpp:29: undefined reference to `_imp___ZN6Phonon11MediaObject4playEv'
    5. debug/***.o:D:\Projects\***-build-desktop/../***/***.cpp:28: undefined reference to `_imp___ZN6Phonon11MediaSourceD1Ev'
    6. debug/***.o:D:\Projects\***-build-desktop/../***/***.cpp:34: undefined reference to `_imp___ZN6Phonon11AudioOutputC1ENS_8CategoryEP7QObject'
    7. debug/***.o:D:\Projects\***-build-desktop/../***/***.cpp:35: undefined reference to `_imp___ZN6Phonon11Me***-build-desktop/../***/***.cpp:36: undefined reference to `_imp___ZN6Phonon11MediaObject15setTickIntervalEi'
    8. debug/***.o:D:\Projects\***-build-desktop/../***/***.cpp:37: undefined reference to `_imp___ZN6Phonon10createPathEPNS_9MediaNodeES1_'
    9. debug/***.o:D:\Projects\***-build-desktop/../***/***.cpp:37: undefined reference to `_imp___ZN6Phonon4PathD1Ev'
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Phonon linking problem

    Did you compile Qt with Phonon support?
    Or, did you install the Qt Phonon library (it might be separate on your system)

  3. #3
    Join Date
    Aug 2010
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Phonon linking problem

    Yes, I would assume that Phonon is installed because I am able to compile the phonon example, as well as it runs fine. Also, in my lib directory in Qt, I have libphonon.a and libphonond.a

  4. #4
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Phonon linking problem

    Do you have this line:
    Qt Code:
    1. QT += phonon
    To copy to clipboard, switch view to plain text mode 
    in your .pro file?

  5. #5
    Join Date
    Aug 2010
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Phonon linking problem

    Yes sir I do

  6. #6
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Phonon linking problem

    I have tried to replicate that, and i can't

    The only case when i get that errors, is missing QT += phonon, did you "rebuild" (run qmake again) after adding the QT += phonon? (sometimes simply clicking on the Build button <the green one> doesn't rebuild and the compiler still doesn't find the libraries, even if added)

    Also check that <Phonon/MediaObject> and <Phonon/MediaSource> files are included, not only forward declared.

  7. The following user says thank you to Zlatomir for this useful post:

    Decessus (13th August 2010)

  8. #7
    Join Date
    Aug 2010
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Phonon linking problem

    Well I manually ran qmake, since rebuild did not work, and it is not trying to link the phonon libs

    Qt Code:
    1. Running build steps for project ***...
    2. Starting: "c:/qt/2010.04/qt/bin/qmake.exe" D:/Projects/***/***.pro -r -spec win32-g++
    3. The process "c:/qt/2010.04/qt/bin/qmake.exe" exited normally.
    To copy to clipboard, switch view to plain text mode 

    This is my .pro file
    Qt Code:
    1. QT += core gui \
    2. phonon
    3.  
    4. TARGET = ***
    5. TEMPLATE = app
    6.  
    7. SOURCES += main.cpp\
    8. ***.cpp
    9.  
    10. HEADERS += ***.h
    11.  
    12. FORMS += ***.ui
    13.  
    14. RESOURCES += \
    15. images.qrc
    To copy to clipboard, switch view to plain text mode 

  9. #8
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Phonon linking problem

    One thing that might be a problem is the difference in build configurations between the phonon libs and your program.

    Is the Qt and Phonon library compiled with the same compiler and settings as your program?

  10. #9
    Join Date
    Aug 2010
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Phonon linking problem

    I never manually compiled any of the libs, I downloaded the SDK for Windows.

  11. #10
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Phonon linking problem

    Bingo :-)

    Which version did you download? Visual studio version or minGW?

    After finding out which you downloaded, how do you build your program. Using visual studio? or the minGW tools?

    If both differ, you get these errors.

  12. #11
    Join Date
    Aug 2010
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Phonon linking problem

    I downloaded the minGW version as well as I use the minGW toolchain

  13. #12
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Phonon linking problem

    You downloaded the minGW toolchain separatly? If so, this might also be a problem.

    Suggestion:

    Remove all
    Download the latest Qt SDK. This includes everything and works out of the box.

  14. #13
    Join Date
    Aug 2010
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Phonon linking problem

    No I did not download it seperately, I use the MinGW toolchain that comes with the SDK

  15. #14
    Join Date
    Aug 2010
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Phonon linking problem

    Is there a qmake flag that I can manually invoke for libphonon?

  16. #15
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Phonon linking problem

    Quote Originally Posted by Decessus View Post
    Is there a qmake flag that I can manually invoke for libphonon?
    I'm not sure what you mean, but I guess no.
    You include the phonon library with QT += phonon

    What you see are linker errors which means that the linker can't find certain symbols in the phonon library.
    This in turn means that the library isn't found or it is compiled with another compiler (symbols are messed up).

    Since neither case describes your problem, I'm out of ideas.
    Can you please give more information? Describe exactly what you downloaded, every step you did between installing what you downloaded and building your program, including the full source code.

  17. The following user says thank you to tbscope for this useful post:

    Decessus (13th August 2010)

  18. #16
    Join Date
    Aug 2010
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Phonon linking problem

    Hmm, well I seemed to have solved my problem, which apparently was caused by manually including windows.h in an attempt to use PlaySound();

    Thank you for your patience and help

Similar Threads

  1. Qt linking problem
    By LovesTha in forum Newbie
    Replies: 3
    Last Post: 30th March 2009, 23:31
  2. Linking problem on Mac os x 10.4
    By maverick_pol in forum General Programming
    Replies: 0
    Last Post: 6th January 2008, 14:09
  3. Linking problem
    By prosass in forum Newbie
    Replies: 3
    Last Post: 2nd March 2007, 12:22
  4. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41
  5. linking problem
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2006, 14: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.