I am working on a die class that allows the user to input the number of sides on a die and outputs the number of rolls per die and the resulting number. I am very new to classes and I know I have them messed up, but can't work through them right now because the linker is giving me an error in Xcode and codeblocks.
The exact error is:
Undefined symbols for architecture x86_64:
  "GameDie::GameDie()", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And here is my program code:
 #include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int x = 0;
int sides;
class GameDie
{
public:
    GameDie();
    int roll();
    void getNumSides(int numSides);
    void getNumRolls();
private:
    int numRolls;
    int numSides;
};
int main()
{
    srand(time(0));
    cout << "Enter number of sides: ";
    cin >> sides;
    GameDie die1;
    die1.roll();
    die1.getNumSides(sides);
    die1.getNumRolls();
    return 0;
}
int GameDie::roll()
{
    return (rand() % sides) + 1;
}
void GameDie::getNumSides(int sides)
{
    numSides = sides;
}
void GameDie::getNumRolls()
{
    x++;
    cout << "Roll " << x << " of die with " << sides << " sides";
}
 
    