问题
I try to use wxSound to play sound, but when I try to compile and linking all project. I have this error:
C:\wxWidgets-3.0.2\build\msw/../../include/wx/msw/winundef.h:171: undefined reference to `PlaySoundW@12'
I Google it and got the answer about adding option -lwinmm to the linker. But it doesn't help
回答1:
What are you compiling and linking exactly? Have you tried building the sound
sample that comes with wxWidgets?
This function is definitely in winmm.lib
and wxWidgets makefiles already link with it. If they work and your code doesn't, chances are that you simply didn't add -lwinmm
option in the correct place.
来源:https://stackoverflow.com/questions/29137226/wxsound-undefined-reference-to-playsoundw12