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. Unresolved external symbol for waveOutGetDevCaps and waveOutGetNumDevs
Forum Updated to NodeBB v4.3 + New Features

Unresolved external symbol for waveOutGetDevCaps and waveOutGetNumDevs

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 906 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.
  • S Offline
    S Offline
    socke
    wrote on last edited by
    #1

    Hi qt people,

    I am fairly new to qt and I am trying to retrieve and print out my connected audio devices. However I receive this error when trying to build. I've added my .pro and main.cpp file.

    error messages:

    • main.obj:-1: error: LNK2019: unresolved external symbol __imp__waveOutGetNumDevs@0 referenced in function _mai

    • main.obj:-1: error: LNK2019: unresolved external symbol __imp__waveOutGetDevCapsW@12 referenced in function _main

    I have tried compiling with Desktop Qt 5.14.2 MSVC2015-17, 32/64bit with no difference. Also tried Mingw-32/64-bit.

    .pro file:

    TEMPLATE = app
    CONFIG += console c++11
    CONFIG -= app_bundle
    CONFIG -= qt
    
    win32:LIBS += -lkernel32 -lkernel32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32
    
    
    SOURCES += \
            main.cpp
    

    main.cpp

    #include <windows.h>
    #include <mmsystem.h>
    #include <iostream>
    #include <mmeapi.h>
    
    
    using namespace std;
    
    int main()
    {
        cout << "Hello World!" << endl;
        int nSoundCardCount = waveOutGetNumDevs();
    
         for (int i = 0; i < nSoundCardCount; i++)
         {
             WAVEOUTCAPS woc;
             waveOutGetDevCaps(i, &woc, sizeof(woc));
    
             cout << woc.szPname << endl;
         }
    
        return 0;
    }
    

    Any ideas on why this occurs?

    Thanks,
    Socke

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

      Hi and welcome to devnet,

      You are not linking to the Winmm library.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • S Offline
        S Offline
        socke
        wrote on last edited by
        #3

        @SGaist, Thanks, I totally forgot about that library. I used it before when I compiled with mingw-w64 in my terminal. Big thanks.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          Since you have it working now, please mark the thread as solved using the "Topic Tools" button or the three doted menu beside the answer you consider correct so that other forum users may know a solution has been found :-)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply
          1
          • SGaistS SGaist

            You're welcome !

            Since you have it working now, please mark the thread as solved using the "Topic Tools" button or the three doted menu beside the answer you consider correct so that other forum users may know a solution has been found :-)

            S Offline
            S Offline
            socke
            wrote on last edited by
            #5

            @SGaist Got it! Btw, when you said "..welcome to devnet". What did you mean by devnet? Did you mean? I reckon that devnet means dev..something network? Just trying to fill in the missing pieces here :-)

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              It's an old habit I kept coming from years ago when the forum was the "Qt Developer Network".

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1

              • Login

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