Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSound problems, mySoundObj.play() and QSound::play(fileName) won't compile. [solved, added QT += multimedia]
Forum Update on Tuesday, May 27th 2025

QSound problems, mySoundObj.play() and QSound::play(fileName) won't compile. [solved, added QT += multimedia]

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pwnstar23
    wrote on last edited by
    #1

    QSound::play("TimerBeep.wav");

    Produces the following errors on compilation

    C:\SkyDrive\QT_Projects\build-TimerReminder-Desktop_Qt_5_0_2_MinGW_32bit-Debug\debug\TimerMessageDialog.o:-1: In function `ZN18TimerMessageDialog10UpdateBeepEv':

    C:\SkyDrive\QT_Projects\TimerReminder\TimerMessageDialog.cpp:58: error: undefined reference to `_imp___ZN6QSound4playERK7QString'

    C:\SkyDrive\QT_Projects\build-TimerReminder-Desktop_Qt_5_0_2_MinGW_32bit-Debug\debug\TimerMessageDialog.o:-1: In function `_tcf_0':

    C:\SkyDrive\QT_Projects\TimerReminder\TimerMessageDialog.cpp:4: error: undefined reference to `_imp___ZN6QSoundD1Ev'

    gSound.play();

    produces the following errors on compilation

    C:\SkyDrive\QT_Projects\build-TimerReminder-Desktop_Qt_5_0_2_MinGW_32bit-Debug\debug\TimerMessageDialog.o:-1: In function `ZN18TimerMessageDialog10UpdateBeepEv':

    C:\SkyDrive\QT_Projects\TimerReminder\TimerMessageDialog.cpp:58: error: undefined reference to `_imp___ZN6QSound4playEv'

    C:\SkyDrive\QT_Projects\build-TimerReminder-Desktop_Qt_5_0_2_MinGW_32bit-Debug\debug\TimerMessageDialog.o:-1: In function `_tcf_0':

    What's going on here, if I comment this play line out everything compiles fine, even the constructor for QSound on my global object.

    [solved, added QT += multimedia]

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved