This is the exact error code:
LNK2019 unresolved external symbol "public: __thiscall guessingGame::guessingGame(void)" (??0guessingGame@@QAE@XZ) referenced in function _main
I am not sure what is going on. When I tried changing the arguments, the error went away but then I got too few arguments and when I tried making sure all of the symbols matched it still gave me the error. I have no idea what to do.
Driver.cpp
#include "pch.h"
#include <iostream>
#include "Game.h"
using namespace std;
int main()
{
int howManyNumbers = 0, range = 0;
cout << "Enter the Number of Integers (n): ";
cin >> howManyNumbers;
cout << "Enter the Number of Each Integer from 1 to (m): ";
cin >> range;
guessingGame start;
start.createRandomNumbers(howManyNumbers, range);
}
Game.h
#ifndef Game
#define Game
#include "pch.h"
#include <stdlib.h>
#include <iostream>
using namespace std;
class guessingGame {
int numberRight = 0;
int numberGuessed;
int numbers[];
public:
guessingGame();
void createRandomNumbers(int n, int m);
};
Game.cpp
#include "pch.h"
#include "Game.h"
void guessingGame::createRandomNumbers(int n, int m) {
for (int i = 0; i < n; i++) {
numbers[i] = 1 + rand() % m;
}
while (numberRight < n) {
cout << "Enter your guesses for the " << n << " integers in the range from 1 to " << m << " that have been selected: ";
cin >> numberGuessed;
for (int i = 0; i < n; i++) {
if (numberGuessed = numbers[i]) {
numberRight++;
cout << numberRight << " of your gusses are correct. Guess again.";
}
}
}
}