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 doesn't work outside of Qt Creator on Windows
Qt 6.11 is out! See what's new in the release blog

QSound doesn't work outside of Qt Creator on Windows

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 775 Views 2 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.
  • D Offline
    D Offline
    Donald Duck
    wrote on last edited by Donald Duck
    #1

    I'm trying to use QSound in my Qt program. I'm trying to play a sound which is in the Qt resources. I use the following code:

    QSound::play(":/exemple.wav");
    

    When I run my program from Qt Creator, everything works well. But when I run my program on Windows from Windows explorer, it doesn't make any sound. When I run my program on Mac or Linux, even outside of Qt Creator, it works.

    I tried literally copying the content of all the subfolders of C:\Qt\5.10.1\msvc2015 into the executable's folder in case some DLLs or other files were missing, but it didn't help (I know that a lot of those files like the includes aren't necessary for the executable, but I still tried).

    I also tried to use files on the hard drive (using the absolute path in the program) instead of qrc resources, but it still didn't work.

    How to get QSound to work outside of Qt Creator?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Make sure you make a proper deployment folder
      You can use the tool
      http://doc.qt.io/qt-5/windows-deployment.html

      also look here
      http://www.tripleboot.org/?p=138

      the subfolders of C:\Qt\5.10.1\msvc2015 might NOT reflect how the DLLS should be located.

      1 Reply Last reply
      4

      • Login

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