link error

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", "***",}
};


int pc ;


int main()
{

OPP ();

system ("pause");
cout << endl;
menu ();

return 0 ;
}
void menu()
{
char choice;
string choice1;

cout << "1: Select Song to play" << endl;
cout << "2: Edit / Add song" << endl;
cout << "3: Search for a song "<< endl;

cout << "What would you like to do?: \n";
getline (cin, choice1);
cout << endl;
choice = choice1 [0];

switch (choice)
{
case '1':
list();
break;
case '2':
listedit();
break;
//case '3':
// search();
// break;
}
}

int search()
{
string choice;
string choice2;
char res;
string p;
int x;
/*vector<char>myvector(library,library+6);
vector<char>::iterator it;
*/

cout << "What would you like to search for" << endl;
cout << "1: ID" << endl;
cout << "2: Artist" << endl;
cout << "3: Song" << endl;
cout << "4: Album" << endl;
getline (cin, choice);

res = choice [0];
x = atoi (p.c_str());
switch (res)
{

case '1':
cout <<"what Id would u like to search for"<< endl;
getline (cin, p);
for ( x = 1; x <= 6 ; x++)
{
cout << left
<< setw(5)
<< library[x].ID
<< setw(15)
<< library[x].artist
<< setw(25)
<< library[x].song
<< setw(20)
<< library[x].album
<< setw(7)
<< library[x].rating
<< setw (6)
<< library [x].playcount<< endl;
}
cout << endl;

case '2':
cout <<"what Artist would u like to search for"<< endl;
getline (cin, p);
for ( x = 1; x <= 6 ; x++)
{
cout << left
<< setw(5)
<< library[x].ID
<< setw(15)
<< library[x].artist
<< setw(25)
<< library[x].song
<< setw(20)
<< library[x].album
<< setw(7)
<< library[x].rating
<< setw (6)
<< library [x].playcount<< endl;
}
cout << endl;

case '3':
cout <<"What Song would u like to search for"<< endl;
getline (cin, p);
for ( x = 1; x <= 6 ; x++)
{
cout << left
<< setw(5)
<< library[x].ID
<< setw(15)
<< library[x].artist
<< setw(25)
<< library[x].song
<< setw(20)
<< library[x].album
<< setw(7)
<< library[x].rating
<< setw (6)
<< library [x].playcount<< endl;
}
cout << endl;

case '4':
cout <<"What Album would u like to search for"<< endl;
getline (cin, p);
for ( x = 1; x <= 6 ; x++)
{
cout << left
<< setw(5)
<< library[x].ID
<< setw(15)
<< library[x].artist
<< setw(25)
<< library[x].song
<< setw(20)
<< library[x].album
<< setw(7)
<< library[x].rating
<< setw (6)
<< library [x].playcount<< endl;
}
cout << endl;

}

return 1;

}


void OPP ()
{

for (int t= 0; t < 6 ; t++)
{
cout << left
<< setw(5)
<< library[t].ID
<< setw(15)
<< library[t].artist
<< setw(25)
<< library[t].song
<< setw(20)
<< library[t].album
<< setw(7)
<< library[t].rating
<< setw (6)
<< library [t].playcount<< endl;
}

}

int listedit ()
{
char choice;
string choice1;

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;

}

cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
"| |\n"
"| |\n" ;
cout << "|" << "Now PLaying:"<< library[response].song<< "|"<< endl;
cout << "| |\n"
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
system ("pause");


}while (charresponse != "q");
}
}
}

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;

getline (cin, userchoice);
cout << endl;
response = userchoice [0] ;

/*if (response == 1)*/
switch (response)
{
case 1:
do
{
/*char i = 'i';*/
for (i = 0; i < 5; i ++)
{
cout << "Enter song ID" << endl;
getline (cin, ID);
library[i].ID = atoi (ID.c_str());
cout << endl;

cout << "Enter artist name" << endl;
getline (cin , library[i].artist);
cout << endl;

cout << "Enter Song Name" << endl;
getline ( cin, library[i].song);
cout << endl;

cout << "Enter album name" << endl;
getline (cin, library[i].album);
cout << endl;

cout << " Enter rating" << endl;
getline (cin , library[i].rating);
cout << endl;

cout << setw (5)
<< library [ i ].ID
<< setw (20)
<< library [ i ].artist
<< setw (20)
<< library [ i ].song
<< setw (20)
<< library [ i ].album
<< setw (20)
<< library [ i ].rating << endl << endl ;


cout << "Do you want to add another song (y/n) " << endl;
getline (cin,userchoice);
cout << endl;

if ( response == n )
{
break ;
}
}

}while(response == y);

/*if (response == 2)*/
case 2:
{
OPP ();

cout << " What song would you like to edit" << endl;
getline (cin, userchoice);
choice2 = atoi (userchoice.c_str());

cout << setw (5)
<< library [choice2].artist
<< setw(20)
<< library [choice2].song
<< setw(20)
<< library [choice2].album
<< setw(20)
<< library [choice2].rating << endl << endl;
do
{
cout << "What part of this song would you like to change" << endl;
cout << "1 Artist" << endl;
cout << "2 Song " << endl;
cout << "3 Album " << endl;
cout << "4 Rating "<< endl;
getline (cin, response1);
response2 = response1 [0];


switch ( response2 )
{
case 1: cout << library [choice2].artist;
getline (cin, library [choice2].artist);
break;

case 2: cout << library [choice2].song;
getline (cin, library [choice2].song);
break;

case 3: cout << library [choice2].album;
getline (cin, library [choice2].album);
break;

case 4: cout << library [choice2].rating;
getline (cin, library [choice2].rating);
break;
}

OPP () ;


cout << "edit another part (y/n) " << endl;
getline (cin, ct);
}while (ct == "y");
}


}
return 0;
}

void delte()
{
string response;
string file;
int response1;
//int i;
//int pt;

OPP ();

cout << "What song would you like to delete"<< endl;

getline (cin, response);
response1 = atoi (response.c_str());

library[response1].artist = '_';
library[response1].song = '_';
library[response1].album = '_';
library[response1].rating = '_';
library[response1].playcount = '_';

OPP ();

ofstream outfile(file.c_str(), ofstream::app );

outfile << library[response1].artist << library[response1].song
<< library[response1].album << library[response1].rating
<< library[response1].playcount << "\n";

outfile.close();

}
void shuffle( int songcount)
{
int randomNumber;
int tempNumber;
songlist temp [1] ;

for (int i =0; i < 6; i++)
{
if (library [ 1 ] .ID == 999 )
break ;

randomNumber = rand () % 6 ;
tempNumber = library [ i ] .ID ;
library [ i ].ID = library [ randomNumber ].ID ;
library [randomNumber ].ID = tempNumber ;

}

for ( int pass= 0; pass < 6; pass ++)
{
for (int row = 0; row < 6; row ++)
{
if (library[row].ID > library [row + 1].ID)
{
temp [0] = library [row];
library [row] = library [row + 1];
library [row + 1] = temp [1];
}
}

}

OPP ();

cout << "Songs Are Now Being shuffled";

cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
"| |\n"
"| |\n" ;
cout << "|" << "Now PLaying:"<< library[randomNumber].song<< "|"<< endl;
cout << "| |\n"
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";

}
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.
[code][/code
]Error 2 error LNK1120: 1 unresolved externals C:\Users\Big D\Documents\Visual Studio 2010\Projects\ctunes-2- harrisdu\Debug\ctunes-2- harrisdu.exe 1 1 ctunes-2- harrisdu



Error 1 error LNK2019: unresolved external symbol "void __cdecl shuffle(void)" (?shuffle@@YAXXZ) referenced in function "void __cdecl list(void)" (?list@@YAXXZ) C:\Users\Big D\Documents\Visual Studio 2010\Projects\ctunes-2- harrisdu\ctunes-2- harrisdu\harrisdu.obj ctunes-2- harrisdu
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.
it was a good suggestion but it still gives the same error message
Topic archived. No new replies allowed.