I'm having an issue with this externals error problem, and i have no idea how to fix, if someone can help me it would be much appreciated. Here's my program for a mp3 player:
#include <iostream>
#include <iomanip>
//#include <algorithm>
//#include <vector>
//#include <cctype>
#include <string>
#include <windows.h>
#include <time.h>
#include <fstream>
#include "colors.h"
#include "MP3Play.h"
using namespace std ;
void list();
void menu();
void OPP () ;
int listedit();
void delte();
int edit();
void shuffle ();
int search ();
// Global
struct songlist
{
int ID;
string artist;
string song;
string album;
string rating;
string playcount;
};
songlist library[]={
{0, "Artist", "Song Title", "Album", "Rating", " Playcount"},
{1, "Bruno Mars","Grenade","Doo Wop & Hooligans", "*****"},
{2, "Lil John", "Snap Yo' Fingers", "Crunk Juice", "*****"},
{3, "Run DMC", "Trickey", "Greatest Hits", "*****"},
{4, "2-Pac", "Ambitionz Az A Ridah", "All Eyez On Me", "****"},
{5, "2-Pac", "How Do You Want It", "All Eyez On Me", "***",}
};
cout <<"What would you like to do" << endl;
cout <<"1 Edit a song/ Add a song" << endl;
cout <<"2 Delete a song" << endl;
getline (cin, choice1);
choice = choice1 [0];
cout << endl;
switch (choice)
{
case 1:
edit();
break;
case 2:
delte ();
break;
}
return 0 ;
}
void list ()
{
string charresponse ;
char response;
char y = 'y';
char Y = 'Y';
char q = 'q';
/*int *ptr;*/
while (true)
{
cout <<"Would you like to Shuffle Music (y/n)" << endl ;
getline(cin, charresponse);
cout << endl;
system ("pause");
if (charresponse == "y")
{
cout << "Songs Are Now Being shuffled" << endl;
shuffle ();
break;
}
else if ((charresponse != "y") || ( charresponse != "Y"))
{
cout << " Now PLaying All Songs" << endl;
system ("Pause");
system ("cls");
break;
OPP ();
cout << endl;
cout <<"What song would you like to play\n";
cout <<"Or press q to quit" << endl;
do
{
if (charresponse == "q")
{
break;
}
getline (cin, charresponse);
response = atoi ( charresponse.c_str());
cout << endl;
for (pc = 0; pc < 1; pc++)
{
library [response].playcount;
cin >> pc;
int edit()
{
char response;
string userchoice;
char choice2;
string ID;
char response2;
string response1;
string ct ;
int i;
char y = 'y';
char n= 'n';
char m = 'm';
cout << "Welcome to the edit menu\n";
cout << "What would you like to do\n";
cout << "1 : Add a song\n";
cout << "2 : Edit a song\n";
cout << "Or press b to go back" << endl;
Please use the code tags on the right side of the page.
I don't see anything in your set of included libraries that would require a library to link to except maybe somethings in windows.h, what exactly is the error we are seeing? A copy and paste would be best.
I can't really give you a code line because you didn't use the code brackets but you are calling the "shuffle()" function from within "void list()" without passing it any arguments, but in your definition you tell it to expect an integer as an argument. Judging by the lack of arguments in your forward declaration, I'd say delete the "int songcount" from the argument list in your definition.