I tried the following code snippet from Petzold:
case WM_CREATE:
PlaySound(TEXT("hellowin.wav"), NULL, SND_FILENAME | SND_ASYNC) ;
return 0 ;
And got the following POLINK: error: Unresolved external symbol '__imp_PlaySoundA'.
Version 8.00.19 Release Candidate #6 (Win64), included <windows.h>, <mmsystem.h>
This is not a bug.
Do not include <mmsystem.h>. Including windows.h is all you need to do.
Add >> Winmm.lib << to: Project options->Linker->Library and object files
Thank you, it works well using Winmm.lib!
NB. Flag constants ('SND_FILENAME' etc.) are declared in <mmsystem.h> so I must include it.
No, windows.h automatically includes appropriate headers.
It looks it was a side effect of #define WIN32_LEAN_AND_MEAN (from a program template).
I remove it along with <mmsystem.h>.
Thanks!