0

I'm kinda new to stack overflow so let me know how I can improve my format for asking questions and displaying code.

My problem is that I keep getting a Linker error undefined reference to Father::Father() and undefined reference to Father::display()

Here is my code:

Father.h

#ifndef FATHER_H
#define FATHER_H
#include <iostream>

class Father
{
      public:
             Father();
             void display();


      private:



};

#endif

Father.cpp

#include <iostream>
#include "Father.h"

Father::Father
{

}
void Father::display()
{

     std::cout << "I am your father" << std::endl;
}


/*
This is my enter code here

*/

Test.cpp

#include <iostream>
#include "Father.h"



int main()
{
    Father Darth;
    Darth.display();


    system("pause");
}

1 Answers1

0

Linking two .cpp and a .h files

I just saw this as a possible solution, I'm thinking I'm having problems with linking H files with CPP files.

Community
  • 1
  • 1