我在用DEV-C++写easyx图形库代码时,添加背景音乐的代码怎么会报错?求指教。
代码:
#include<graphics.h>
#include<conio.h>
#include<bits/stdc++.h>
#pragma comment(lib,"Winmm.lib")
void loading(){
settextstyle(20,0,"楷体");
settextcolor(YELLOW);
int ans=3;
while(ans!=0){
ans--;
outtextxy(190,230,"正在加载中");
for(int i=300;i<360;i+=20) {
outtextxy(i,230,". ");
Sleep(1000);
}
cleardevice();
}
}
void BGM(){
mciSendString(L"open .\marro.mp3 alias bkmusic",NULL,0,NULL);
mciSendString(L"play bkmusic repeat", NULL, 0, NULL);
}
int main()
{
initgraph(500,500);
loading();
BGM();
getch();
closegraph();
return 0;
}
报错图片: