Base class undefined. Error C2504

Viewed 2051

Following this tutorial(https://www.youtube.com/watch?v=gq2Igdc-OSI&index=52&list=PLAE85DE8440AA6B83) I encountered 4 errors on Visual Studio C++ 2017. 3 of them are the same thing and just repeat 'Mother': base class undefined in the daughter.h file. The other error reads:'sayName' is not a member of 'Daughter' Now here is the code. It is quite simple what I want the program to print...I want it to print out two lines of "What are you doing there?" If you could help me with this answer, that would be great. Thank you. For the Main file `#include "stdafx.h" #include #include"Daughter.h" #include"Mother.h" using namespace std;

int main()
{
    Mother pot;
    pot.sayName();
    Daughter kettle;
    kettle.sayName();
    int pause = 0;
    cin >> pause;
}

Mother.h
#ifndef MOTHER_H
#define MOTHER_H

class Mother
{
public:
    Mother();
    void sayName();

};

#endif
Mother.cpp
#include "stdafx.h"
#include<iostream>
#include"Daughter.h"
#include"Mother.h"
using namespace std;

Mother::Mother()
{
}
void Mother::sayName() {
    cout << "What are you doing there?" << endl;

 }
Daughter.h
#ifndef DAUGHTER_H
#define DAUGHTER_H

class Daughter:public Mother
{
public:
    Daughter();
};
#endif
Daughter.cpp
#include "stdafx.h"
#include<iostream>
#include"Daughter.h"
#include"Mother.h"
using namespace std;

Daughter::Daughter()
{
}
1 Answers
Related