wxSound. Undefined reference to PlaySoundW@12

醉酒当歌 提交于 2021-02-05 08:25:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!