Home > Back-end >  C: why don't compile PlaySound function correctly
C: why don't compile PlaySound function correctly

Time:09-27

compile Error [Error] ld returned 1 exit status don't know much about
because must first solve the problem of the play, so the code more humble

[b] source: [/b
#include
#include
#include//contains getch () statement the header file
#include
#include
#include//MCI library header file
# pragma comment (lib, "winmm. Lib")
//links/specified MCI library, McISendString function definition in winmm.
in the libStruct SongList
{
Char Num [5].
Char Song [20].
Char Singer [20].
Char Album [30].
};
Void PlayList ()
{
Struct SongList Ls [20]={{" 01 ", "the wind moved", "li", "" miss you" "},
{" 02 ", "to accompany me to stray," sad "o", "" to accompany me to stray" "},
{" 03 ", "faith", "eason chan", "" eason chan" "},
{" 04 ", "lullaby", "engine", "" the rose television soundtrack" "},
Leaves {" 5 ", "the myth", "jin sha", "" moon myth" "},
{" 6 ", "may have a heart", "Li Xingliang", "" may have a heart" "},
{" 7 ", "make", "aska," "" "" dove},
{" 08 ", "all for you", "wu ke qun", "" lonely come to do" "},
{" 09 ", "elegant" break up, "lim yee chung," "" "" bride},
{" 10 ", "monkey", "Dai Quan", "" Monkey King" "}};
Printf (" song number song singer album \ n ");
for(int i=0; i<10; I++)
Printf (" % s % s \ \ t t % s % s \ n ", Ls [I] Num, Ls [I] Song, Ls [I] Singer, Ls [I] Album);
}
Void New_Favorities ()
{
Struct SongList Fav [20].
}
Void PlaySong ()
{
Int s;
Printf (" please enter the song number: \ n ");
The scanf (" % d ", & amp; S);
The switch (s)
{
Case 1:
PlaySound (" D://music//FCML wav ", NULL, SND_FILENAME | SND_ASYNC));
break;
}
}
Void menu ();
Int main ()
{
Int the Key;
Do
{
The menu ();
The scanf (" % d ", & amp; Key);
The switch (Key)
{
Case 1://open the playlist
PlayList (); break;
Case 2://play songs
PlaySong (); break;
//case 3:/play/pause
}
} while (Key!=0);
return 0;
}
Void menu ()
{
Printf (" + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + \ n ");
Printf (" | 1. Open the playlist | \ n ");
Printf (" | 2. Play music | \ n ");
Printf (" | 3. Pause music | \ n ");
Printf (" a | | 4. \ n ");
Printf (" the next | | 5. \ n ");
Printf (" | 6. Looping | \ n ");
Printf (" | 7. Open the favorites | \ n ");
Printf (" + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + \ n ");
}

CodePudding user response:

The specified winmm. Lib path? Such as GCC xx - lwinmm

CodePudding user response:

reference 1st floor weixin_47173463 response:
specified winmm. Lib path? Such as GCC xx - lwinmm

Seems to have no, can say specific point

CodePudding user response:

Using devc++, change the compiler to give it a try
  • Related