unresolved external symbol "public: __thiscall PigLatin::PigLatin(void)

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
class PigLatin
{
public:
	PigLatin(void);
	string convertPigLatin(string);
};

string PigLatin::convertPigLatin(string wString)
{
	char vowels[10] = {'a','e','i','o','u','A','E','I','O','U'};

	for (int y=0; y < 10; y++)
	{
		if (wString[0] == vowels[y])
			wString.insert(0, "y");
	}
	
	int wSize = wString.length();

	for (int x=0; x < 10; x++)
	{

		if (wString[wSize -1] == vowels[x])
			wString.insert(wSize, "yay");
	}
	return wString;
}

int main()
{
	PigLatin pLatin;
	cout << pLatin.convertPigLatin("after") << endl;

	cin.ignore();
	cin.ignore();

}


i have no idea what the errors is
99.99999% of the time "unresolved external symbol" means that the linker can't find the body of a function that your program is calling. IE: you declared a function but never gave it a body.

Here, that function is the PigLatin ctor.

Either remove the declaration, or give the ctor a body.
thank u, it solve the problem.
Topic archived. No new replies allowed.