The main file is untitled1.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include <iostream>
#include <string>
#include "PaySystem.h"
using namespace std;
int main()
{
string EmployeeType; //12 scales 14 and 16 scales
cout<<"Please Enter Emplyee Types ";
getline (cin,EmployeeType);
PaySystem MyPaymentSystem("Good To Use");
MyPaymentSystem.employeeTypeSet(EmployeeType);
MyPaymentSystem.displayMsg();
cout<<endl<<endl;
system ("PAUSE");
}
| |
This Class Header file is PaySystem.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cctype>
#include<MyFunctions.h>
using namespace std;
class PaySystem
{
public:
PaySystem(string name);
void employeeTypeSet(string empl);
string employeeTypeGet();
void displayMsg();
private:
string EmployeeType;
};
| |
The CPP file is PaySystem.cpp
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
|
#include <iostream>
#include <string>
#include "PaySystem.h"
using namespace std;
PaySystem::PaySystem(string name)
{
employeeTypeSet(name);
}
void PaySystem::employeeTypeSet(string empl)
{
EmployeeType = empl;
}
string PaySystem::employeeTypeGet()
{
return EmployeeType;
}
void PaySystem::displayMsg()
{
cout<<"\n\n----------Welcome-----------\n\n\n"
<<" Syes's Pay System For \n\n"
<<" "<<employeeTypeGet()
<<"\n\n"
<<" You can calculate Saleries Through This System ";
}
| |
The Problem i face when i compile the PaySystem.cpp is
[Linker error] undefined reference to `WinMain@16'
ld returned 1 exit status
The Problem i face when i compile the untitled1.cpp is
[Linker error] undefined reference to `PaySystem::PaySystem(std::string)'
[Linker error] undefined reference to `PaySystem::employeeTypeSet(std::string)'
[Linker error] undefined reference to `PaySystem::displayMsg()'
ld returned 1 exit status
please help