編譯報錯[Error] ld returned 1 exit status 不太懂
因為要先解決播放的問題,所以代碼比較簡陋
[b]源代碼:[/b
#include<stdio.h>
#include<string.h>
#include<conio.h> // 包含getch()宣告的頭檔案
#include<stdlib.h>
#include<Windows.h>
#include<mmsystem.h> // mci庫頭檔案
#pragma comment(lib, "winmm.lib")
// 鏈接/指定MCI庫,mciSendString函式的定義在winmm.lib中
struct SongList
{
char Num[5];
char Song[20];
char Singer[20];
char Album[30];
};
void PlayList()
{
struct SongList Ls[20]={{"01"," 風吹麥浪 "," 李健 "," 《想念你》 "},
{"02","陪我去流浪"," 阿悄 "," 《陪我去流浪》 "},
{"03"," 傷信 "," 陳奕迅 "," 《陳奕迅》 "},
{"04"," 搖籃曲 ","動力火車","《薔薇之戀電視原聲帶》"},
{"05"," 星月神話 "," 金莎 "," 《星月神話》 "},
{"06","愿得一人心"," 李行亮 "," 《愿得一人心》 "},
{"07"," 讓 "," 楊宗緯 "," 《鴿子》 "},
{"08","全部都給你"," 吳克群 "," 《寂寞來了怎么辦》 "},
{"09","優雅的分手"," 林宇中 "," 《新娘》 "},
{"10"," 悟空 "," 戴荃 "," 《悟空》 "}};
printf( "歌曲編號 歌名 歌手 專輯\n" );
for(int i=0;i<10;i++)
printf(" %s %s\t %s\t %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("請輸入歌曲編號:\n");
scanf("%d",&s);
switch(s)
{
case 1:
PlaySound("D://music//fcml.wav",NULL,SND_FILENAME | SND_ASYNC));
break;
}
}
void menu();
int main()
{
int Key;
do
{
menu();
scanf("%d",&Key);
switch(Key)
{
case 1: //打開歌單
PlayList(); break;
case 2: //播放歌曲
PlaySong(); break;
// case 3: //暫停播放
}
}while(Key!=0);
return 0;
}
void menu()
{
printf("+--------------------------+\n");
printf("| 1.打開歌單 |\n");
printf("| 2.播放音樂 |\n");
printf("| 3.暫停音樂 |\n");
printf("| 4.上一首 |\n");
printf("| 5.下一首 |\n");
printf("| 6.回圈播放 |\n");
printf("| 7.打開收藏夾 |\n");
printf("+--------------------------+\n");
}
uj5u.com熱心網友回復:
指定winmm.lib路徑了嗎?例如gcc xx -lwinmmuj5u.com熱心網友回復:
貌似沒有,能說具體一點嗎
uj5u.com熱心網友回復:
用的是devc++嗎,換個編譯器試試看轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/81106.html
標籤:C語言
上一篇:騎士巡游問題可達性試探法有解嗎
下一篇:c語言
