【发布时间】:2009-10-14 10:23:34
【问题描述】:
我尝试在我的编码中播放音乐文件,但失败了。我的音乐文件位于保存 .cpp 文件的同一文件夹中。
有人可以帮我吗?
我的代码是:
#include <iostream>
#include <windows.h>
int main() {
PlaySound("kenny g.WAV", NULL, SND_ASYNC);
}
【问题讨论】:
-
使用 GetErrorCode() 函数得到的错误代码是什么?
-
我不确定 GetErrorCode() 但错误消息是 [Linker error]undefined reference to 'PlaySound@12' id returned 1 exit status
-
你需要 winmm.lib 来播放 Luis 提到的音乐