Error When Trying To Load A Sound File

Hi everyone. I'm not sure if this is the correct forum for my question, but here goes. I've been working on a program using Windows API. I'm attempting to play a sound file when the program opens, using this function:

 
PlaySound(TEXT("Startrek.wav"), NULL, SND_FILENAME | SND_ASYNC);


When I compile the program, I get this error:
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol __imp__PlaySoundW@12 referenced in function "long __stdcall WinProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WinProc@@YGJPAUHWND__@@IIJ@Z) First Window C:\Users\Matthew\Documents\Visual Studio 2015\Projects\First Window\First Window\First Widow 2.1.4.obj 1

Here's what's interesting. I have a example program from the book I'm studying. This program plays a wav file that says, "Hello World!" upon running the program. Originally, this program used to function as intended. However, now, it only plays a Windows sound, rather than the "Hello World" wav file. So, my question is, this sounds like it's more a problem with my computer, not my program itself. Does anyone have any suggestions as to where I should start to fix this problem?
> this sounds like it's more a problem with my computer, not my program itself
you'll solve nothing with that attitude.


> unresolved external symbol
http://www.cplusplus.com/forum/general/113904/#msg622060

https://msdn.microsoft.com/en-us/library/windows/desktop/dd743680(v=vs.85).aspx
Winmm
It sounds like you're describing two problems.

1.) The linker error
2.) Despite the linker error, you have an older state of the program which doesn't function as intended (plays default system event sound).

You probably haven't linked your project to the "winmm.lib" library.
As for your second problem, take a look at this thread:

http://www.cplusplus.com/forum/general/187532/
Topic archived. No new replies allowed.