各位大佬,我用的软件是codeblocks,电脑是惠普的暗夜精灵4,以下是我编写播放音乐的c语言的代码
#include< stdio.h>
#include < stdlib.h>
#include< windows.h>
#include< mmsystem.h>
#pragma comment(lib,"winmm.lib")
int main()
{
while(1)
{
PlaySound(TEXT("\sounds"),
NULL, SND_FILENAME | SND_ASYNC | SND_LOOP );
return 0;
}
}
也在编译器的链接器设置中写了-lwinmm,也在该程序的文件夹的bin-debug中放置文件夹songs,里面都是wav式的音乐,但编译时始终出现ignoring #pragma comment的字样,
那位大神路过能帮忙解决一下,不胜感激。
通过测试,其实是使用的vc有问题,使用vs2017完全没有问题