dependencies - Undefined reference to Class::Class() and functions in one file? c++ -
everything compiling fine, , i've looked through 10 different questions on here trying solve including this, this, , this. please don't kill me, i've been beating head against wall 3 hours now. i've tried building offending file , seems build fine, when build project still throws same errors.
i've tried moving include ".h's" cpp files when possible of time still didn't help. when change
bitboards *newboard = new bitboards;
to
bitboards *newboard;
the error on line goes away, still gives me "undefined refrence to" newboard-> functions.
is there else glaringly obvious, or not, should try?
the errors pop in logic file here: ai_logic.cpp
//master bitboard turn bitboards *newboard = new bitboards; ^^here //master zobrist object ai turn zobristh *mzobrist = new zobristh; //master evaluation object - evaluates board position , gives int value (- black) evaluatebb *meval = new evaluatebb; newboard->constructboards(); ^^and here 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 problem might come movegen.h/cpp 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"
#include bitboards.cpp
in ai_logic file seemed trick. absolutely no idea why.
Comments
Post a Comment