PlaySound( ); problems

Started by
0 comments, last by Beserkerfork 21 years, 7 months ago
I am slowly plugging my way through ''Tricks of the Windows Game Programming Gurus'' and all of a sudden I am hitting a bad building error in VC++. I have gone through some examples using PlaySound() already, and ended with functional sounds coming out of my beautiful little black window... but now I don''t anymore. Here is the exert from my WindowProc(), but I am confident (enough) in my code, since I am now getting the same errors using his demos that came with the book. case MENU_SOUND_ID_SOUND: { PlaySound( "techno", hinstance_app, SND_RESOURCE | SND_ASYNC | SND_LOOP ); return(0); } break; And here are my building errors: Linking... mydemo.obj : error LNK2001: unresolved external symbol __imp__PlaySoundA@12 Debug/hj.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. hj.exe - 2 error(s), 0 warning(s) There is nothing wrong with the .wav file- and I am wondering if I screwed something up on my puter somehow, or if there is just simply something I am overlooking... either way, help is appreciated- and let me know if you need more info, Thanks.
Advertisement
You''re not linking to the library that contains PlaySound. Look up the PlaySound docs in MSDN to see what library you need to link to.

I think it''s winmm32.lib, but I''m not 100% sure.

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions

This topic is closed to new replies.

Advertisement