Your getting a linking error because it can't find the actual implementation of PlaySound. You need to link to the appropriate library winmm.lib either in the project settings or explicitly for Visual Studio by using this line near the top of the file.