Link to home
Start Free TrialLog in
Avatar of chrisrobinson
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.
Avatar of tma050898
tma050898
Flag of United States of America image

How are you linking to the winmm.lib file. IOW, how did you add it to your project?
Avatar of eric_m
eric_m

__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]"


Avatar of chrisrobinson

ASKER

Thanks - I wasn’t linking properly!  I am now, in Project Settings, Object/library modules: winmm.lib
ASKER CERTIFIED SOLUTION
Avatar of tma050898
tma050898
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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