Playing sound in Windows error.

I can't play a sound for some odd reason. It gives me this error:
Error LNK2019 unresolved external symbol __imp__PlaySoundA@12 referenced in function _main
Here is my code.
1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include <Windows.h>
using namespace std;

int main() {
	char response;
	PlaySound(TEXT("PacmanDies.wav"), NULL, SND_FILENAME | SND_ASYNC);
	cin >> response;
	return 0;
}
You need to add Winmm.lib either with

#pragma comment(lib, "Winmm.lib") // somewhere above main

or include it in the projects settings
Topic archived. No new replies allowed.