今天,研究VC++中使用windows系统函数PlaySound()播放声音的方法;代码写好后,编译链接,报如下错误:
null
unresolved external symbol __imp__PlaySoundA@12……
搜索资料,发现问题是没有包含对应的库文件。
解决方案如下:
方法一:
在源代码开头加入这两行:
#include <mmsystem.h>
#pragma comment(lib,”winmm.lib”)
方法二:
VC6: Project -> Settings -> Link -> Project Options -> 加入winmm.lib
VS2008/2010/2012:
Project -> Properties -> Linker -> Input -> Additional Dependencies -> 加入winmm.lib
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容