Everything was compiling fine, and I've looked through about 10 different questions on here trying to solve it including this, this, and this. Please don't kill me, I've been beating my head against the wall for about 3 hours now. I've also tried building the offending file by itself and it seems to build fine, but when I build the project it still throws the same errors.
I've tried moving the include ".h's" into only the cpp files when possible which was most of the time but that still didn't help. When I change
BitBoards *newBoard = new BitBoards;
to
BitBoards *newBoard;
the error on that line goes away, but it still gives me the "undefined refrence to" the newBoard-> functions.
Is there anything else glaringly obvious, or not, that I should try?
The errors pop up in my logic file here: Ai_Logic.cpp
//master bitboard for turn
BitBoards *newBoard = new BitBoards;
^^here
//master zobrist object for ai turn
ZobristH *mZobrist = new ZobristH;
//master evaluation object - evaluates board position and gives an int value (- for black)
evaluateBB *mEval = new evaluateBB;
newBoard->constructBoards();
^^and here as well as every instance of newBoard-> below
Ai_Logic.h:
#include <string>
#include <stack>
#include <thread>
class Pieces;
class ZobristH;
class BitBoards;
class MoveGen;
class evaluateBB;
class HashEntry;
class Ai_Logic
{
//stuff
};
Ai_Logic.cpp
#include "ai_logic.h"
#include <algorithm>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include "externs.h"
#include "move.h"
#include "evaluatebb.h"
#include "bitboards.h"
#include "movegen.h"
#include "zobristh.h"
BitBoards.h
class MoveGen;
class ZobristH;
class Move;
class BitBoards
{
//stuff
};
BitBoards.cpp
#include "bitboards.h"
#include <cmath>
#include <random>
#include <iostream>
#include <string>
#include <cstdio>
#include "externs.h"
#include "movegen.h"
I think the problem might come from my MoveGen.h/cpp but i'm not entirely sure
MoveGen.h
#include <iostream>
#include <string>
#include "move.h"
class Pieces;
class BitBoards;
class ZobristH;
class MoveGen
{
//stuff
};
MoveGen.cpp
#include "movegen.h"
#include "bitboards.h"
#include "Pieces.h"