title: Issues with inheritance and polymorphism
body: <p>I'm currently learning inheritance and polymorphism in C++, and am coming across this issue when trying to create a child of a parent class that inherits and defines a virtual function.</p>
  <p>The goal is for <code>HumanPlayer</code> to be a child of <code>Player</code>, and to create its own implementation of <code>insertion()</code> (a function that inserts an input into a tic-tac-toe board, once complete), however, I have run into a few errors that I can't seem to get by. I'm getting a dwarf error saying</p>
  <blockquote>
  <p>There's an undefined reference to 'vtable for Player'. In function Player::Player() and Player::~Player().</p>
  </blockquote>
  <p>As well as another dwarf error saying</p>
  <blockquote>
  <p>Undefined reference to 'typeinfo for Player'.</p>
  </blockquote>
  <p>Any help with this would be greatly appreciated.</p>
  <p>Player.cpp:</p>
  <pre><code>#include &lt;iostream&gt;
    #include &lt;string&gt;
    #include &quot;Player.h&quot;
   
    Player::Player() {
        name = &quot;Zoe&quot;;
        myState = 0;
        isWon = false;
   }
  </code></pre>
  <p>Player.h</p>
  <pre><code>#ifndef PLAYER_H
    #define PLAYER_H
   
    class Player {
        Player();
      protected:
        std::string name;
         int myState;
        bool isWon;
    public:
        virtual void insertion();
    };
   
   #endif
  </code></pre>
  <p>HumanPlayer.h :</p>
  <pre><code> #ifndef HUMANPLAYER_H
    #define HUMANPLAYER_H
   
    #include &quot;Player.h&quot;
   
    class HumanPlayer : public Player {
    public:
        HumanPlayer();
        void insertion();
   protected:
        std::string Name1;
        std::string Name2;
         int humanCheck=0;
         std::string getName();
         int toInsert;
    };
   #endif
  </code></pre>
  <p>HumanPlayer.cpp</p>
  <pre><code> #include &lt;iostream&gt;
    #include &lt;string&gt;
    #include &quot;Player.h&quot;
    #include &quot;HumanPlayer.h&quot;
   
    HumanPlayer::HumanPlayer() {
        if(humanCheck == 0) {
       std::cout&lt;&lt;&quot;Player One type your name&quot;;
       scanf(&quot;%s&quot;, Name1);
       std::cout&lt;&lt;&quot;Player Two type your name&quot;;
       scanf(&quot;%s&quot;, Name2);
       humanCheck++;
       }
   }
   
   
   void HumanPlayer::insertion() {
    if(humanCheck % 2 ==0) {
       std::cout&lt;&lt;Name2&lt;&lt;&quot;'s turn, please enter an integer between 1 and 7&quot;;
           scanf(&quot;%i&quot;, &amp;toInsert);
        } else {
       std::cout&lt;&lt;Name1&lt;&lt;&quot;'s turn, please enter an integer between 1 and 7&quot;;
           scanf(&quot;%i&quot;, &amp;toInsert);
        }
        humanCheck++;
   }
  </code></pre>