Unresolved External Errors with PlaySound?
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
Did you include dsound.lib in your project?? because it''s giving you a linking error, it COULD be because of this..
Erik
Erik
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
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
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement