Full error:
error LNK2019: unresolved external symbol "public: int __thiscall Perzon::PrintAge(void)" (?PrintAge@Perzon@@QAEHXZ) referenced in function _main C:\Users\Srb1313\documents\visual studio 2013\Projects\FirstClass\FirstClass\FirstClass.obj FirstClass
My Folder Structure:
Perzon.h:
#ifndef Perzon_H
#define Perzon_H
#include <iostream>
#include <string>
using namespace std;
class Perzon
{
public:
Perzon();
Perzon(string firstName, string lastName);
string PrintName();
int PrintAge();
private:
string mfirstname;
string mlastname;
int mage;
};
#endif
Person.cpp:
#include "Perzon.h"
#include <string>
using namespace std;
Perzon::Perzon()
{
mfirstname = "Sammy";
mlastname = "Bartletty";
mage = 19;
}
Perzon::Perzon(string firstname, string lastname)
{
mfirstname = firstname;
mlastname = lastname;
}
void PrintName(string firtname, string lastname)
{
cout << "Name is " << firtname << " " << lastname;
}
void PrintAge(int age)
{
cout << "Age is " << age;
}
FirstClass.cpp:
#include "Perzon.h"
#include <iostream>
int main()
{
Perzon p("sam", "b");
p.PrintAge();
};
Can anyone help me here? I have no idea why im getting this error it has had me stumped for so long! Any help is much appreciated.