I am getting the following error whenever I try to have a Hand object inside the Player class. As soon as the constructor of the Player class is invoked it shows the following error message:
Undefined symbols for architecture x86_64: "Hand::Hand()", referenced from: Player::Player() in player-939de2. ld: symbol(s) not found for architecture x86_64
Player.h
#ifndef h_player
#define h_player
#include <string>
#include "hand.h"
using namespace std;
class Player{
private:
    Hand* hand;
    string name;
public:
    Player();
    void setName(string);
    void setHand(Card);
    string print() const;
    void showHand() const;
};
#endif
Player.cpp
#include <iostream>
#include <string>
#include "player.h"
#include <iomanip>
using namespace std;
Player::Player() {
    name = "";
    hand = new Hand();
    //std::cout<< "here";
}
void Player::setName(string name) {
    this->name = name;
}
string Player::print() const {
    return this->name;
}
void Player::setHand(Card add) {
    hand->addCard(add);
}
void Player::showHand() const {
    for(int i = 0; i < 7; i++) {
        Card myCard = hand->showCard();
        std::cout << "|" << std::setfill(' ') << std::setw(18) << std::right << myCard.print() << std::setfill(' ') << std::setw(18) << std::right << "|" << std::endl;
    }
}
Hand.h
#ifndef h_hand
#define h_hand
#include <string>
#include "card.h"
using namespace std;
const int number_of_cards = 7;
class Hand {
private:
    Card *cards;
    int no_of_books;
    int cards_remaining;
public:
    Hand();
    void addCard(Card);
    bool checkHand();
    Card showCard() const;
    void withdraw();
};
#endif
Hand.cpp
#include <iostream>
#include <string>
#include "hand.h"
using namespace std;
Hand::Hand() {
    cards = new Card[7];
    cards_remaining = 7;
    no_of_books = 0;
}
void Hand::addCard(Card add) {
    if(cards_remaining > 0) {
        cards[cards_remaining] = add;
        cards_remaining--;
    }
}
Card Hand::showCard() const {
    return cards[cards_remaining++];
}
