inheritance problem

hi people so basically my code is right to my knowledge but the compiler disagrees i have the right syntax so I don't know what the problem is,heres my code.

people.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  
 #define PEOPLE_H
#include "person.h"

class people
{
    public:
        people();
        void print();

    protected:

    private:
};

#endif // PEOPLE_H



people.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  
#include "people.h
#include <iostream>

using namespace std;

people::people()
{


}

void people:: print(){

  cout << "hi my name";
}



person.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

#define PERSON_H
#include "people.h"

class person: public people
{
    public:
        person();


    private:
};

#endif // PERSON_H

  


person.cpp

1
2
3
4
5
6
7
8
9
10
11
12
  
#include <iostream>
#include "person.h

using namespace std;


person::person()
{
    //ctor
}
Last edited on
Your CPP modules don't include your headers.
sorry you are right, fixed them I added them but I am still getting the same error

the error message I am getting is

line 6 error: expected class-name before '{' token
Topic archived. No new replies allowed.