I tried CodeBlocks and MS VC++ 2010 but both fail to compile.
They can't find the definition for PlaySound() in . What is the Problem?
case WM_CREATE:
PlaySound (TEXT("hellowin.wav"), NULL, SND_FILENAME | SND_ASYNC) ;
return 0 ;
Errors:
error C2065: 'SND_FILENAME': nichtdeklarierter Bezeichner
error C2065: 'SND_ASYNC': nichtdeklarierter Bezeichner
error C3861: "PlaySound": Bezeichner wurde nicht gefunden.
windows.h is included in stdafx.h but even if I include it directly in codeblocks it doesn't work.
The symbols for
PlaySoundandSND_…are declared inmmsystem.hheader and defined in thewinmm.liblibrary. You must include and link against those.