Solved

PlaySound Problems

Posted on 1998-07-16
4
259 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

911 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

23 Experts available now in Live!

Get 1:1 Help Now