继续求助 怎么用C\C++播放音乐

xw595921313 2011-04-03 05:26:55
#include <mmsystem.h>
PlaySound("K:\\111.MP3", NULL, SND_FILENAME | SND_ASYNC);
组合使用编译的时候提示
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
...全文
543 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
ffjj56 2011-04-04
  • 打赏
  • 举报
回复
可能是mmsystem.h里的某些东东需用到windows.h里的定义或者宏吧
Nick_Deng_Gamer 2011-04-04
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 firefoxbug 的回复:]
引用 5 楼 xw595921313 的回复:

引用 3 楼 firefoxbug 的回复:
这是什么原因??求教!!

在#include<mmsystem.h>前面加一个头文件include <windows.h>就可以了

我意思是为什么在#include<mmsystem.h>前面加一个头文件include <windows.h>就可以解决问题了
没加之前为什么会报这样的……
[/Quote]
貌似是因为你在播放音乐的时候要使用<window.h>中的一些定义,就像播放音乐要使用播放器一下吧.....
firefoxbug 2011-04-03
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 xw595921313 的回复:]

引用 3 楼 firefoxbug 的回复:
这是什么原因??求教!!

在#include<mmsystem.h>前面加一个头文件include <windows.h>就可以了
[/Quote]
我意思是为什么在#include<mmsystem.h>前面加一个头文件include <windows.h>就可以解决问题了
没加之前为什么会报这样的错?
delphiwcdj 2011-04-03
  • 打赏
  • 举报
回复
JF 恭喜
pathuang68 2011-04-03
  • 打赏
  • 举报
回复
恭喜恭喜
xw595921313 2011-04-03
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 firefoxbug 的回复:]
这是什么原因??求教!!
[/Quote]
在#include<mmsystem.h>前面加一个头文件include <windows.h>就可以了
xw595921313 2011-04-03
  • 打赏
  • 举报
回复
在#include<mmsystem.h>前面加一个头文件include <windows.h>就可以了
firefoxbug 2011-04-03
  • 打赏
  • 举报
回复
这是什么原因??求教!!
xw595921313 2011-04-03
  • 打赏
  • 举报
回复
解决了 忘记加#include<windows.h>了。。谢谢
sxqinge 2011-04-03
  • 打赏
  • 举报
回复
看下还有需要添加什么组件的吗?

33,321

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 新手乐园
社区管理员
  • 新手乐园社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧