Archived

This topic is now archived and is closed to further replies.

PlaySound( ); problems

This topic is 5580 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites