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. Play a sound with Qt5 and Windows 8 + minWG
Qt 6.11 is out! See what's new in the release blog

Play a sound with Qt5 and Windows 8 + minWG

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 3.1k 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.
  • A Offline
    A Offline
    arkero24
    wrote on last edited by
    #1

    Good evening everbody:

    I'm really new in Qt, and I like it so much, there are many reasons why. In fact I've built a simple app type widget. This app consists in a game in which system randomly choose a number in order to be guessed by a player. Everything goes fine. But I need add some sound (wav files) to my app, according the situation (You all know far more than me). For short this is my line of code to add some sound:
    QString sonido="audio/newGame.wav";
    QSound player(sonido);
    player.play();

    And this is the message error i get:

    E:\QtFilesPros\wtnBoy\wingame.cpp:77: error: undefined reference to `_imp___ZN6QSoundC1ERK7QStringP7QObject'

    May I get your help? Thanks a million for your support. What can I do to solve this problem?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      arkero24
      wrote on last edited by
      #2

      "...:)""

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        welcome to devnet

        The error message seem to stem from a missing object file or library. You have either not added the cpp-file to your project and therefore, it is not compiled or in case of a lib, the reference to the lib is missing.
        Alternatively, it may come from mixed compile models (e.g. one of the modules has been compiled with a different compiler or memory model).
        This happens when you download a library compiled with a different compiler or memory model and mixed things. Modules compiled with different compilers msvc (2005, 2008, 2010, 2012) cannot be mixed. Also at least the object files MinGW 4.6 and 4.7 are not compatible. The same certainly for mixing 32 and 64 bit for all compilers.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • A Offline
          A Offline
          arkero24
          wrote on last edited by
          #4

          Thanks a lot for your answer.
          Couldyou advice me how to solve this?

          In fact, I had installed, previously, qt creator 5.0 with vs 2010, but it caused me some problems (At first, i got a message of a missing compiler, this is why I decided to change). As I told before I'm new, so given that the first version didn't work properly, I decided to install minWG. And it worked with this version.

          There's no manual to install Qt5 with vs2010. Which are the features needed to install it in Windows 8?

          Thanks for your support.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sanchir Kartiev
            wrote on last edited by
            #5

            http://qt-project.org/doc/qt-5.0/qtmultimedia/audiooverview.html

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MuldeR
              wrote on last edited by
              #6

              @_imp___something@

              ...is usually related to DLL imports.

              Are you sure you are linking against all import libraries for all required DLL's?

              Should be in QtGui.DLL, I think.

              My OpenSource software at: http://muldersoft.com/

              Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

              Go visit the coop: http://youtu.be/Jay...

              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