VC编译链接报错”unresolved external symbol __imp__PlaySoundA@12″的解决方法

今天,研究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
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容