PlaySound in Eclipse

How I can open a .wav without this error: "undefined reference to `PlaySoundA@12'"?

1
2
3
4
5
6
7
8
9
  void ventoinhaligar(portaSerial *p) {
		p->enviaSerial(3);
		cout << "Tocando Alerta" << endl;
		PlaySound(TEXT("beep-02.wav"), NULL, SND_SYNC);
		Sleep(1500);
		ventoinha = true;
		cout << "Ventilação Ligada" << endl;

	}	 
Step 1: Look up the function in MSDN
https://docs.microsoft.com/en-us/previous-versions/dd743680(v%3Dvs.85)#requirements
Step 2: Read the manual page, noting that PlaySoundA is defined in winmm.lib
Step 3: Ensure that you are linking winmm.lib, and that link order is correct

Last edited on
Thank you!
I needed to add library winmm to Eclipse.
Topic archived. No new replies allowed.