Solved

PlaySound Problems

Posted on 1998-07-16
4
258 Views
Last Modified: 2010-04-10
I am using Visual C++ and am simply trying to play a .WAV file when certain actions are performed. I have the syntax all down, but when I try to compile I get unresolved external linkage errors.

error LNK2001: unresolved external symbol __imp__PlaySoundA@12

Please help me with this...
Reply to dereks@shaw.wave.ca
0
Comment
Question by:Dsweet
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:warmcat
ID: 1167982
Hi sweetie -

You need to link with winmm.lib... mine is at

\Microsoft\Dev Studio\Vc\lib\Winmm.lib

-Andy
0
 

Author Comment

by:Dsweet
ID: 1167983
I have winmm.lib in the directory :

/Program Files/DevStudio/VC/LIB

And this is the first entry listed in my Tool->Options->Directories->Lib Files, yet I still get an unresolved linkage error.
0
 
LVL 2

Accepted Solution

by:
warmcat earned 200 total points
ID: 1167984
No wonder you do, sweets, you have to add the library to your project just as if it was a .c file; ie, it must appear on the FileView tab along with your other sources.

Use Project|Add to project|Files... to do this.


0
 

Author Comment

by:Dsweet
ID: 1167985
Excellent job my man!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now