Pero tengo un problemita que no entiendo que puede ser.
Pego codigo aca:
MAIN.C
Código:
FUNCTION.C#include <stdlib.h> #include <iostream> #include "windows.h" #include "mmsystem.h" #include <msacm.h> #include "function.h" #pragma comment(lib, "libwinmm.a") using namespace std; int main() { HWAVEIN hWaveIn; MMRESULT i; WAVEFORMATEX waveform; //open waveform audio for input waveform.wFormatTag = WAVE_FORMAT_PCM; waveform.nChannels = 1; waveform.nSamplesPerSec = 8000; waveform.wBitsPerSample = 16; waveform.cbSize = 0; waveform.nBlockAlign = (waveform.nChannels * waveform.wBitsPerSample)/8; waveform.nAvgBytesPerSec = (waveform.nSamplesPerSec*waveform.nBlockAlign); i = waveInOpen(&hWaveIn, WAVE_MAPPER, &waveform, (DWORD)waveInFunc, 0, CALLBACK_FUNCTION); switch(i){ case MMSYSERR_ALLOCATED: cout << "Error: MMSYSERR_ALLOCATED\n"; break; case MMSYSERR_BADDEVICEID: cout << "Error: MMSYSERR_BADDEVICEID\n"; break; case MMSYSERR_NODRIVER: cout << "Error: MMSYSERR_NODRIVER\n"; break; case MMSYSERR_NOMEM: cout << "Error: MMSYSERR_NOMEM\n"; break; case WAVERR_BADFORMAT: cout << "Error: WAVERR_BADFORMAT\n"; break; case MMSYSERR_NOERROR: cout << "Error: MMSYSERR_NOERROR\n"; break; default: cout << "Error desconocido\n"; } cout << "Todo joia!" << std::endl; return 0; }
Código:
FUNCTION.H#include <stdlib.h> #include "function.h" void CALLBACK waveInFunc(HWAVEIN hwi, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2){ }
Código:
cuando lo compilo me tira esto:#include "windows.h" void CALLBACK waveInFunc(HWAVEIN hwi, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2);
Código:
No entiendo, alguna sugerencia?undefined reference to `_Z10waveInFuncP9HWAVEIN__jmmm@20'
saludos