Now it gets hairy!
You are talking GUI programming and need to bind with winmm.lib or such, or perhaps load winmm.dll. BCX makes that easy and has a sample! Dev-Cpp has something like like libwinmm.a in the \lib directory. Maybe we have to wait till Narue wakes up, he knows everything and will help you!
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
>You are talking GUI programming
No, PlaySound isn't a GUI function, but it does require linking with a new library.
>can anyone help to show the problem
You need to link with winmm.lib. IIRC you can go to the Project menu, select Project Options, then in the box titled "Object File or Linker Options" add -lwinmm.lib to the list. I'm fairly certain that the library is available--but not linked--by default for Dev-C++, so after doing this your build should work fine.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
If you succeed in DevCpp with this sound project, please post it! By the way, just in case you are curious, this would be the code for BCX, a one liner, short and simple! If you look at the generated C code, it uses PlaySound() from the winmm.dll which is in the Windows\system32\ directory. Compiles to a 24k executable that chimes.
PlayWav("chimes.wav")
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
kakilang seems to be bored and needs something to chew on. I just threw up a little code snippet called "An AVI Media Player (GUI code for Dev C++)" check it out there.
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
> Can you please tell me how to solve this?
Perhaps by starting your own thread, and not hijacking some thread over 2 years old.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953