Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. waveInOpen - Unresolved External Symbol !

waveInOpen - Unresolved External Symbol !

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++databasequestion
5 Posts 3 Posters 0 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
    Paddy
    wrote on last edited by
    #1

    Hi, I'm very new to VC++ and I hope someone can help me out! I'm trying to write a program to take audio samples from the sound card but I keep getting an "unresolved external symbol" error and I have no idea why! I have the code to set up the wave format but once I try and query the soundcard it complains. Am I doing something wrong? Record Sound error LNK2019: unresolved external symbol__imp__waveInOpen@24 referenced in function "void__cdecl RecordWaveFile(void)" (?RecordWaveFile@@YAXXZ) void RecordWaveFile() { HWAVEIN WaveHandle; WAVEFORMATEX WaveFormat; WaveFormat.wFormatTag = WAVE_FORMAT_PCM; WaveFormat.nChannels = 1; WaveFormat.nSamplesPerSec = 22050; WaveFormat.wBitsPerSample = 8; WaveFormat.nAvgBytesPerSec = 22050; WaveFormat.nBlockAlign = 1; WaveFormat.cbSize = 0; int Res = waveInOpen(&WaveHandle, WAVE_MAPPER, &WaveFormat, 0, 0, WAVE_FORMAT_QUERY); if (Res == WAVERR_BADFORMAT) return; } Thanks in advance, Paddy.

    B 1 Reply Last reply
    0
    • P Paddy

      Hi, I'm very new to VC++ and I hope someone can help me out! I'm trying to write a program to take audio samples from the sound card but I keep getting an "unresolved external symbol" error and I have no idea why! I have the code to set up the wave format but once I try and query the soundcard it complains. Am I doing something wrong? Record Sound error LNK2019: unresolved external symbol__imp__waveInOpen@24 referenced in function "void__cdecl RecordWaveFile(void)" (?RecordWaveFile@@YAXXZ) void RecordWaveFile() { HWAVEIN WaveHandle; WAVEFORMATEX WaveFormat; WaveFormat.wFormatTag = WAVE_FORMAT_PCM; WaveFormat.nChannels = 1; WaveFormat.nSamplesPerSec = 22050; WaveFormat.wBitsPerSample = 8; WaveFormat.nAvgBytesPerSec = 22050; WaveFormat.nBlockAlign = 1; WaveFormat.cbSize = 0; int Res = waveInOpen(&WaveHandle, WAVE_MAPPER, &WaveFormat, 0, 0, WAVE_FORMAT_QUERY); if (Res == WAVERR_BADFORMAT) return; } Thanks in advance, Paddy.

      B Offline
      B Offline
      BlackSmith
      wrote on last edited by
      #2

      Add to your project settings, under 'Link->Object/Library modules' tab, Winmm.lib. That's bout-it. :cool:**

      --BlackSmith--

      **/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.

      P 1 Reply Last reply
      0
      • B BlackSmith

        Add to your project settings, under 'Link->Object/Library modules' tab, Winmm.lib. That's bout-it. :cool:**

        --BlackSmith--

        **/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.

        P Offline
        P Offline
        Paddy
        wrote on last edited by
        #3

        Thanks, You wouldn't believe how long I've been trying to fix that for!!!

        L 1 Reply Last reply
        0
        • P Paddy

          Thanks, You wouldn't believe how long I've been trying to fix that for!!!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Alternatively, you can also put #pragma comment(linker, "winmm.lib") to the top of the source file. That's the way I do it whenever I need to link with a new lib file apart from the ones already set in the linker options regards

          P 1 Reply Last reply
          0
          • L Lost User

            Alternatively, you can also put #pragma comment(linker, "winmm.lib") to the top of the source file. That's the way I do it whenever I need to link with a new lib file apart from the ones already set in the linker options regards

            P Offline
            P Offline
            Paddy
            wrote on last edited by
            #5

            Thanks for the help

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups