The root problem is that the function “PlaySound()” is also a windows function, so there is a name collision if you or a third party lib is including Windows.h (or include a header file which includes windows.h somewhere in its dependency tree). It can be hard to find precisely which include files are including the windows.h file, but you need to find them all.
Once you have found the instances of “Windows.h”, you have to sandwich it like so:
This is all you need. If you keep getting this error in spite of adding these include sandwiches, then you have multiple header files trying to include “Windows.h”! Gotta find them all and give them the same treatment.
This took me all day to figure out. I hope this helps someone else.