chrisrobinson
asked on
PlaySound problem
1. I have MS Developer Studio 97 with VC++ V5.0 running under Windows 95.
2. I am trying to use:
PlaySound("train.wav", NULL, SND_FILENAME);
with #include <mmsystem.h> & winmm.lib in place.
3. I get the error msg:
Linking...
DirectSound1View.obj : error LNK2001: unresolved external symbol __imp__PlaySoundA
Debug/DirectSound1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
2. I am trying to use:
PlaySound("train.wav", NULL, SND_FILENAME);
with #include <mmsystem.h> & winmm.lib in place.
3. I get the error msg:
Linking...
DirectSound1View.obj : error LNK2001: unresolved external symbol __imp__PlaySoundA
Debug/DirectSound1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
How are you linking to the winmm.lib file. IOW, how did you add it to your project?
__imp__PlaySoundA is in the library winmm.lib. It appears you aren't linking to it.
Are you generating a build log file (.plg)? From Tools | Options | Build, check "write build file" and then after attempting the build, look at it. Is there a line similar to this?
Creating command line "link.exe winmm.lib [other options deleted]"
Are you generating a build log file (.plg)? From Tools | Options | Build, check "write build file" and then after attempting the build, look at it. Is there a line similar to this?
Creating command line "link.exe winmm.lib [other options deleted]"
ASKER
Thanks - I wasn’t linking properly! I am now, in Project Settings, Object/library modules: winmm.lib
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much.
Chris,
No problem. BTW, I've got all kinds of wave file code if you run into problems just email me at tma-ng@mindspring.com
Take care,
Tom
No problem. BTW, I've got all kinds of wave file code if you run into problems just email me at tma-ng@mindspring.com
Take care,
Tom