problem with class creation. unresolved externals

This is supposed to create a class that inherits from the STL string class and use it to find word palindromes. I originally wrote it without the Pstring class as a simple function and it worked fine. I am sure I am just too close to the wall to see the paint right now but if anyone can see why I get the following error during build I would appreciate it.


1>Source.obj : error LNK2019: unresolved external symbol "public: __thiscall Pstring::Pstring(void)" (??0Pstring@@QAE@XZ) referenced in function _main
1>C:\Users\Bobby\Spring 2013\CSIS 297\Visual Studio\Palindrome\Debug\Palindrome.exe : fatal error LNK1120: 1 unresolved externals

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
#include <iostream>
#include<iomanip>
#include <string>



using namespace std;

//Classes
class Pstring : public string // inherit fm STL
{
private:
	string input;
public:
	bool isPalindrome();
	Pstring();
};


int main()
{
	Pstring entry;
	cout << "Enter a word and I will tell you if it is a Palindrome ";
	cin >> entry;
	cout << "Your entry is "<< entry.isPalindrome();

	system ("pause");
	return 0;
}


bool Pstring::isPalindrome()
{
	bool yes = false;
	int size = this->input.size();
	for ( int i=0; i < (size/2); i++)
	{
		if (toupper(input[i]) == toupper(input[size-1-i])) 
		{
			yes = true;
			cout << input[i];// test output to see the action of the loop
		}
		else
			yes = false;
	}
	cout << yes;];// more test output(will be replaced with message)
	return yes;
};
You have not defined the default constructor.
Thanks, I knew I was looking too hard for simple issues - Bobby
Topic archived. No new replies allowed.