LNK1120 and LNK2019 errors

i have tried to fix it but i cant seem to find a way to fix it, can someone give me a hand.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
#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 ;


int 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;
		string path;
	};

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 ;
char songplay[MAX_PATH+1];


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 ;
}

int list (string playsong) 
{
	
	string charresponse ;
	char response;
	char y = 'y';
	char Y = 'Y';
	char q = 'q';
	/*int response2;*/
	string string1;
	string string2;
	string string3;
	string string4;
	/*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;	
Last edited on
Here's the rest of it
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
	do
	 {
		
				getline (cin, charresponse);
				response = atoi ( charresponse.c_str());
				cout << endl;
				
			/*	for (response2 = 0; response2 < 1; response2++)
				{
					library [response2].playcount = library[response2].playcount ++  ;;
					cin >> pc;
					
				}*/

				cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
						"|                                               |\n"
						"|                                               |\n" ;
				cout << "|" << "Now PLaying:"<< library[response].ID << " "<<library[response].song << "BY" << library[response].artist << endl;
				cout << "|                                               |\n"
						"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
				
				string1 = "C:\\Downloads\\" ;
				string2 = library[response].song ;
                string3 = ".mp3" ;
				string4 = string1 + string2 + string3 ;
				library[response].path = string3 ;
				MP3Play(library[response].path);
				
				system ("pause");
				
				if (charresponse == "q")
				 {
					break;
				 }
		
	}while (charresponse != "q");
	 }
	}
	return 0;
}

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 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";

}
thanks for the help
Topic archived. No new replies allowed.