现在的位置: 首页 > 综合 > 正文

使用sndPlaySound时的错误syntax error : missing ‘;’ before identifier ‘MMVERSION’的解决

2013年10月24日 ⁄ 综合 ⁄ 共 274字 ⁄ 字号 评论关闭

使用sndPlaySound时,出现错误提示syntax error : missing ';' before identifier 'MMVERSION'

原因是UINT没有定义,而UINT是在windows中定义的,

所以在#include<mmsystem.h>前加#include<windows.h>就行了。

注意顺序,如果在#include<mmsystem.h>之后加#include<windows.h>也会出现该错误。


有关sndPlaySound的使用,如果是在控制台下,就不要其他标识参数了,直接sndPlaySound(文件路径)就好,否则报错。

抱歉!评论已关闭.