error LNK2019: unresolved external symbol

I keep getting these error messages:

"error LNK2019: unresolved external symbol "void __cdecl MainPhase(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > *)" (?MainPhase@@YAXPAV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z) referenced in function _main"

"error LNK2019: unresolved external symbol "void __cdecl DrawForKaiba(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > *)" (?DrawForKaiba@@YAXPAV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z) referenced in function _main"

and

" error LNK2019: unresolved external symbol "void __cdecl Beginning(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > *)" (?Beginning@@YAXPAV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z) referenced in function _main"

the code is below


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
#include <stdlib.h>
#include <windows.h>
#include <ctime>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

//srand(time(0));

vector<string> Hand;
vector<string>::iterator it;

vector<string> Field;
vector<string>::iterator Ft;

void Beginning(vector<string> *Hand);
void DrawForKaiba(vector<string> *Hand);
void MainPhase(vector<string> *Hand);
void BattlePhase();
int MainHand;
int CardSlot;
int Decision;


int main()
{
	srand(time(0));

Beginning(&Hand);
DrawForKaiba(&Hand);
MainPhase(&Hand);
BattlePhase();


cout<< "\n"<<"GAME OVER"<<endl;

return 0;
} 



void Beginning(vector<string> &Hand)
{
for (int i=1; i<6; i++)
	{
		DrawForKaiba(&Hand);
	}
}


void DrawForKaiba(vector<string> &Hand)
{

int DrawKaiba = rand() % 40 + 1;
cout<<"Random number is: "<<DrawKaiba<<" "<<endl;

switch (DrawKaiba)
{
case 1:
case 2:
case 3:
	cout<<"BLUE EYES WHITE DRAGON"<<endl;
	Hand.push_back("BLUE EYES WHITE DRAGON");
	break;
case 4:
	cout<<"Vorse Raider"<<endl;
	Hand.push_back("VORSE RAIDER");
	break;
case 5:
	cout<<"BLADE KNIGHT"<<endl;
	Hand.push_back("BLADE KNIGHT");
	break;
case 6:
	cout<<"KAISER SEA HORSE"<<endl;
	Hand.push_back("KAISER SEA HORSE");
	break;
case 7:
	cout<<"LORD OF DRAGONS"<<endl;
	Hand.push_back("LORD OF DRAGONS");
	break;
case 8:
case 9:
case 10:
	cout<<"THUNDER DRAGON"<<endl;
	Hand.push_back("THUNDER DRAGON");
	break;
case 11:
	cout<<"CYBER JAR"<<endl;
	Hand.push_back("CYBER JAR");
	break;
case 12:
	cout<<"SPEAR DRAGON"<<endl;
	Hand.push_back("SPEAR DRAGON");
	break;
case 13:
	cout<<"TWIN HEADED BEHEMOTH"<<endl;
	Hand.push_back("TWIN HEADED BEHEMOTH");
	break;
case 14:
	cout<<"X CANNON HEAD"<<endl;
	Hand.push_back("X CANNON HEAD");
	break;
case 15:
	cout<<"Y DRAGON HEAD"<<endl;
	Hand.push_back("Y DRAGON HEAD");
	break;
case 16:
	cout<<"Z HEAD TANK"<<endl;
	Hand.push_back("Z HEAD TANK");
	break;
case 17:
	cout<<"VAMPIRE LORD"<<endl;
	Hand.push_back("VAMPIRE LORD");
	break;
case 18:
	cout<<"SPIRIT RYU"<<endl;
	Hand.push_back("SPIRIT RYU");
	break;
case 19:
	cout<<"POSSESSED DARK SOUL"<<endl;
	Hand.push_back("POSSESSED DARK SOUL");
	break;
case 20:
	cout<<"LA JINN THE MYSTICAL GENIE OF THE LAMP"<<endl;
	Hand.push_back("LA JINN THE MYSTICAL GENIE OF THE LAMP");
	break;
case 21:
	cout<<"DIFFERENT DIMENSION DRAGON"<<endl;
	Hand.push_back("DIFFERENT DIMENSION DRAGON");
	break;
case 22:
case 23:
case 24:
	cout<<"GIANT GERM"<<endl;
	Hand.push_back("GIANT GERM");
	break;
case 25:
	cout<<"SHRINK"<<endl;
	Hand.push_back("SHRINK");
	break;
case 26:
	cout<<"HEAVY STORM"<<endl;
	Hand.push_back("HEAVY STORM");
	break;
case 27:
	cout<<"MONSTER REBORN"<<endl;
	Hand.push_back("MONSTER REBORN");
	break;
case 28:
	cout<<"POLYMERIZATION"<<endl;
	Hand.push_back("POLYMERIZATION");
	break;
case 29:
	cout<<"POT OF GREED"<<endl;
	Hand.push_back("POT OF GREED");
	break;
case 30:
	cout<<"FLUTE OF SUMMONING DRAGON"<<endl;
	Hand.push_back("FLUTE OF SUMMONING DRAGON");
	break;
case 31:
	cout<<"COST DOWN"<<endl;
	Hand.push_back("COST DOWN");
	break;
case 32:
	cout<<"ENEMY CONTROLLER"<<endl;
	Hand.push_back("ENEMY CONTROLLER");
	break;
case 33:
	cout<<"SILENT DOOM"<<endl;
	Hand.push_back("SILENT DOOM");
	break;
case 34:
	cout<<"SOUL EXCHANGE"<<endl;
	Hand.push_back("SOUL EXCHANGE");
	break;
case 35:
	cout<<"CRUSH CARD"<<endl;
	Hand.push_back("CRUSH CARD");
	break;
case 36:
	cout<<"VIRUS CANNON"<<endl;
	Hand.push_back("VIRUS CANNON");
	break;
case 37:
	cout<<"RING OF DESTRUCTION"<<endl;
	Hand.push_back("RING OF DESTRUCTION");
	break;
case 38:
	cout<<"DRAGON'S RAGE"<<endl;
	Hand.push_back("DRAGON'S RAGE");
	break;
case 39:
	cout<<"FIEND'S SANCTUARY"<<endl;
	Hand.push_back("FIEND'S SANCTUARY");
	break;
case 40:
	cout<<"INTERDIMENSIONAL MATTER TRANSPORTER"<<endl;
	Hand.push_back("INTERDIMENSIONAL MATTER TRANSPORTER");
	break;


}

}//DrawforKaiba




void MainPhase(vector<string> &Hand)
{
	while(1)//so the while loop NEVER breaks unless you have a 'break' later on
	{
	cout<<"Would you like to end the Main Phase? (Yes-'1'  No-'0')"<<endl;
	cin>>Decision;
		if (Decision==1)
		{
			break;
		}

		cout<<"Your hand contains: "<<endl;
		//for (it=Hand.begin(); it<Hand.end(); it++)
		//{
		//	cout<<"   qw "<<*it<<endl;
		//}
		cout<<"Which card in your hand do you wish to play? (if none, press '0')"<<endl;
		cin>>MainHand;
		cout<<"Where do you want to place this card? "<<endl;
		cin>>CardSlot;
		switch (CardSlot)
			{
			case 1:
				cout<<"The card is played in the slot 1"<<endl;
			case 2:
				cout<<"The card is played in the slot 2"<<endl;
			case 3:
				cout<<"The card is played in the slot 3"<<endl;
			case 4:
				cout<<"The card is played in the slot 4"<<endl;
			case 5:
				cout<<"The card is played in the slot 5"<<endl;
			case 6:
				cout<<"The card is played in the slot 6"<<endl;
			case 7:
				cout<<"The card is played in the slot 7"<<endl;
			case 8:
				cout<<"The card is played in the slot 8"<<endl;
			case 9:
				cout<<"The card is played in the slot 9"<<endl;
			case 10:
				cout<<"The card is played in the slot 10"<<endl;
			case 11:
				cout<<"The card is discarded to the Graveyard"<<endl;
			}


    }// end of while(1)

}



void BattlePhase()
{
	while(1)//so the while loop NEVER breaks unless you have a 'break' later on
	{
	cout<<"Would you like to end the Battle Phase? (Yes-'1'  No-'0')"<<endl;
	cin>>Decision;
		if (Decision==1)
		{
			break;
		}

//		cout<<"Your Field contains: "<<endl;
//		for (Ft=Field.begin(); Ft<Field.end();Ft++)
//		{
//			cout<<" "<<*Ft;
//		}
	//	cout<<"Which card on your field do you wish to play? (if none, press '0')"
	//	cin>>Ft;
	//	cout<<"My "<<Field[Ft]<<" ATTACKS! "<<endl;
    }// end of while(1)

}
Your declarations of Beginning, DrawForKaiba, and MainPhase take pointers to string vectors but your definitions are taking references. Also, you didn't #include <string> .
Topic archived. No new replies allowed.