waveInOpen - Unresolved External Symbol !
-
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.
-
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.
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.
-
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.
-
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