Problems with pre compiled header files??

Hi building a program for college, kinda stuck at the first hurdle!!

Im including my classes i have made in the main prog but it keeps saying this

warning C4627: '#include "Manager.h"': skipped when looking for precompiled header use
1> Add directive to 'stdafx.h' or rebuild precompiled header

Not sure what it means?? I took out stdafx.h but did not help not sure where im going wrong!!

Any help is appreciated!

Brendan
You created your project incorrectly. Go make a new project and use "Use Empty Project" to start.
Without code, I can't help any more then the compiler can.
Hi bud ill post my code hope u can help!!


#pragma once
#include <iostream>

using namespace std;

class Manager:public Employee
{
private:
double bonus;
double final_pay;
int hours_worked;
int hourly_rate;


public:
Manager():Employee(){};
void get_bonus();
virtual double calc_payment() = 0;
};

void Manager::get_bonus()
{
cout << " Enter Bonus in £'s ";
cin >> bonus;
}

inline double Manager::calc_payment()
{
return final_pay = (hours_worked * hourly_rate) + bonus;
}



#include "Manager.h"
#include "Employee.h"
#include <iostream>

//using namespace std;


int main()
{
Manager m1;
m1.get_emp_details();
m1.show_details();

return 0;


}




#include <iostream>
using namespace std;

class Employee
{
private:
char* Plname;
char* Pfname;
int hours_worked;
int hourly_rate;
double final_pay;

public:
Employee()
{
Plname = NULL;
Plname = new char;
Pfname = NULL;
Pfname = new char;
hours_worked = 0;
hourly_rate = 0;
final_pay = 0;

void get_emp_details(char *&Plname, char *&Pfname);
virtual double calc_payment() = 0;
void show_details(char *Plname, char *Pfname);


};

void Employee::get_emp_details(char *&Pln, char *&Pfn)
{
cout << " Enter Surname ";
cin >>*Pln;
cout << " Enter First Name ";
cin >>*Pfn;
do
{
cout << " Enter hours Worked ? ";
cin >>hours_worked;
}
while (hourly_rate <0 || hourly_rate >40);

cout << " Enter Hourly Rate ? ";
cin >>hourly_rate;
}

void Employee::show_details(char *Pln, char *Pfn)
{
cout << " Your final Salay is " << final_pay << " Based on " << hours_worked " Worked " <<endl;
}



Caan anyone pls see if they can identify something wrong with this code!!
You're missing a '}' at the end of your constructor definition.
Hi firedraco. I sorted the brace out it's telling me that the employee class is not defined and it's not the base class. Did yourun the code ?? Lol this is doin Ma nut in lol. Bring back vb lol

Again thanks!!
dalejnr88 wrote:
the employee class is not defined and it's not the base class
that's because you didn't #include "Employee.h" in "Manager.h"

btw. int "Manager.h"
virtual double calc_payment() = 0; obviously it's not supposed to be pure virtual so remove that '= 0'
Topic archived. No new replies allowed.