Archived

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

Daishim

Unresolved External Errors with PlaySound?

Recommended Posts

I''m using the code from Andre LaMothe''s Tricks of the Windows Game Programming Gurus in MSVC++ 6 and I get an unresolved external error when using code that I typed in and the code from the book/CD source when using the PlaySound function. From the looks of it, the problem is with the PlaySound function, did they change this function since the book was published? demo3_2.obj : error LNK2001: unresolved external symbol __imp__PlaySoundA@12 test1___Win32_Debug/test1.exe : fatal error LNK1120: 1 unresolved externals

Share this post


Link to post
Share on other sites
Did you include dsound.lib in your project?? because it''s giving you a linking error, it COULD be because of this..

Erik

Share this post


Link to post
Share on other sites
dsound.lib is the DirectSound library. The function PlaySound is a Win32 API function and is found in the library WinMM.lib, so make sure you're linking with that.

I think it's hilarious how nearly everyone around here is programmed like a chicken to think DirectX...

Edited by - merlin9x9 on June 30, 2001 2:10:06 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try including those:

Header: mmsystem.h. // You probably have this, because you can compile

Import Library: winmm.lib. // place this in the linker settings

Note: When you are using standard win32api functions look them up in the msdn. At the bottom of the description is (mostly) a field called "Quick Info" where you can see which headers and libs are required for that function. Very helpful.

baumep

Share this post


Link to post
Share on other sites