|
-
Jun 28th, 2001, 02:54 PM
#1
Thread Starter
PowerPoster
Playing a sound file
I tried this code when the window loads to play a sound file which placed in the directory where my source files are:
Code:
case WM_CREATE:
PlaySound("hellowin.wav" ,NULL,SND_FILENAME | SND_ASYNC);
return 0;
It gives me this error:
hellowin.obj : error LNK2001: unresolved external symbol __imp__PlaySoundA@12
-
Jun 28th, 2001, 03:22 PM
#2
Monday Morning Lunatic
Try adding winmm.lib to the list of libraries (under Project Settings)
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 28th, 2001, 03:54 PM
#3
Thread Starter
PowerPoster
THanks a lot
That works now!
But Why did I need that library?
-
Jun 28th, 2001, 03:57 PM
#4
Monday Morning Lunatic
LOL @ the sig 
Because the library doesn't contain any code, only the definitions for the functions. You'll notice that each library roughtly corresponds to each DLL. Since PlaySound is in winmm.dll (or something similar), it's logical for it to be in winmm.lib. Likewise, Sleep (kernel32.dll) is in kernel32.lib
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|