Error Lnk2019 Playsound
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more
Playsoundw
about Stack Overflow the company Business Learn more about hiring developers or posting ads c++ playsound with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow
Mp3 To Wav
is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PlaySound in C++ [duplicate] up vote 0 down vote favorite This question already has an answer here: What is an undefined reference/unresolved external symbol error and how do I fix it? 25 answers I'm trying to play sounds in my C++ app. We were given a guide to using XACT for it but I can't get it to work so I'm trying to use the PlaySound functions. This is what i've tried. I've also tried it with the whole directory link to where it is saved. int main() { PlaySound("background.mp3", NULL, SND_SYNC); } This is the errors it throws up Error 7 error LNK2019: unresolved external symbol __imp__PlaySoundA@12 referenced in function _main C:\Users\Siyico\Desktop\Legit\w9base\wingl2013_14\SpaceGame.obj wingl2013_14 Error 8 error LNK1120: 1 unresolved externals C:\Users\Siyico\Desktop\Legit\w9base\Debug\wingl2013_14.exe 1 1 wingl2013_14 c++ winapi share|improve this question edited Jan 10 '14 at 2:07 Steve Rowe 15.7k94074 asked Jan 10 '14 at 2:02 user3178851 63 marked as duplicate by chris, MPelletier, Shog9♦ Jan 10 '14 at 4:08 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. What compiler are you using? –Steve Rowe Jan 10 '14 at 2:08 Using VS2012, windows –user3178851 Jan 10 '14 at 2:12 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote You did not link in the required library. Assuming this is the Windows PlaySound function you're talking about, the documentation states that your project requires Winmm.dll for this function. share|improve this answer answered Jan 10 '14 at 2:04 Lightness Races in Orbit 217k35335583 Do I do this by going into the CPP's properties? I see no option for input –user3178851 Jan 10 '14
Studio Languages , Windows Desktop Development > Visual C++ Question 0 Sign in to vote I wanna create a SDI with a dialog , which can play countdown sound after press a button . how ever , the code end up with 2 errors which can not resolved . I check and search the msdn forums and do http://stackoverflow.com/questions/21034935/playsound-in-c get some knowledge but it do not work . so the code will be posted ,and I wanna to get a helping hand : according to some artical , "#include
Specific Boards Windows Programming Playsound problem Getting started with C or C++ | C Tutorial | C++ Tutorial http://cboard.cprogramming.com/windows-programming/64184-playsound-problem.html | C and C++ FAQ | Get a compiler | Fixes http://www.dreamincode.net/forums/topic/113305-playsound-troubles/ for common problems Thread: Playsound problem Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 04-10-2005 #1 rEtard View Profile View Forum Posts rEtaRD r HUMANS TOO !!! Join Date Feb 2005 Posts error lnk2019 80 Playsound problem Hi, im veri new to windows programming and im stucked with a problem with playsound. Code: switch (message) { HINSTANCE hinstance; case WM_LBUTTONDOWN: PlayWav(hinstance); break; ..... } void PlayWav(HINSTANCE hinstance) { PlaySound((LPCSTR)IDR_SELECT, hinstance, SND_ASYNC | SND_RESOURCE); } this is a function i made for testing sounds, it compiled alrite but when i run it, i got error lnk2019 playsound an error: sound.obj : error LNK2001: unresolved external symbol __imp__PlaySoundA@12 Debug/Sound.exe : fatal error LNK1120: 1 unresolved externals What is the problem ? I also tried a very basic code Code: PlaySound("wave.wav", NULL, SND_ASYNC | SND_FILENAME); Gave me the same runtime error. PLEASE HELP ! /* Have a nice day */ 04-10-2005 #2 Ken Fitlike View Profile View Forum Posts Visit Homepage erstwhile Join Date Jan 2002 Posts 2,227 You need to link with Winmm.lib (-lwinmm for MinGW/Dev-Cpp). See your compiler documentations for the specifics of how to link with additional libraries. If you haven't already done so you may have to #include Mmsystem.h, too. For future reference, the lib information (and header) is included in the msdn page for the api, for example see the bottom of the page for PlaySound. CProgramming FAQ Caution: this person may be a carrier of the misinformation virus. 04-10-2005 #3 rEtard View Profile View Forum Posts rEtaRD r HUMANS TOO !!! Join Date Feb 2005 Posts 80 Ken, Can you teach me how to include that lib for
5 Replies - 2448 Views - Last Post: 06 July 2009 - 02:23 PM Rate Topic: #1 gamer55 New D.I.C Head Reputation: 0 Posts: 9 Joined: 05-July 09 Playsound troubles Posted 06 July 2009 - 01:50 AM #include