If you're on visual C++, go project properties -> Linker -> Input -> Additional Dependencies. There, add in the following library (copy and paste): winmm.lib;
Note that this library is OS-dependent and it won't compile on non-windows operating systems. So if you're aiming to make your code portable, don't use this. Use a cross-platform library instead. But if you're just writing for windows, then you should be fine with just the winmm library. You also don't have to include any header files to use the function. Just make sure to link the library to your project.