-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Hey, I cant seem to compile it, I ve tried including and changing some of the code but I am unable, how do you compile it properly?
g++ -o out.o chess_engine.cpp position.cpp tables.cpp types.cpp
In file included from tables.h:3,
from chess_engine.cpp:3:
types.h:109:22: warning: inline function ‘Square pop_lsb(Bitboard*)’ used but never defined
109 | extern inline Square pop_lsb(Bitboard* b);
| ^~~~~~~
In file included from chess_engine.cpp:3:
tables.h:21:27: warning: inline function ‘constexpr Bitboard get_rook_attacks(Square, Bitboard)’ used but never defined
21 | extern constexpr Bitboard get_rook_attacks(Square square, Bitboard occ);
| ^~~~~~~~~~~~~~~~
tables.h:32:27: warning: inline function ‘constexpr Bitboard get_bishop_attacks(Square, Bitboard)’ used but never defined
32 | extern constexpr Bitboard get_bishop_attacks(Square square, Bitboard occ);
| ^~~~~~~~~~~~~~~~~~
In file included from tables.h:3,
from chess_engine.cpp:3:
types.h:113:25: warning: inline function ‘constexpr Square bsf(Bitboard)’ used but never defined
113 | extern constexpr Square bsf(Bitboard b);
| ^~~
types.h:108:19: warning: inline function ‘int sparse_pop_count(Bitboard)’ used but never defined
108 | extern inline int sparse_pop_count(Bitboard x);
| ^~~~~~~~~~~~~~~~
In file included from position.h:3,
from position.cpp:1:
types.h:109:22: warning: inline function ‘Square pop_lsb(Bitboard*)’ used but never defined
109 | extern inline Square pop_lsb(Bitboard* b);
| ^~~~~~~
In file included from position.h:6,
from position.cpp:1:
tables.h:21:27: warning: inline function ‘constexpr Bitboard get_rook_attacks(Square, Bitboard)’ used but never defined
21 | extern constexpr Bitboard get_rook_attacks(Square square, Bitboard occ);
| ^~~~~~~~~~~~~~~~
tables.h:32:27: warning: inline function ‘constexpr Bitboard get_bishop_attacks(Square, Bitboard)’ used but never defined
32 | extern constexpr Bitboard get_bishop_attacks(Square square, Bitboard occ);
| ^~~~~~~~~~~~~~~~~~
tables.cpp: In function ‘constexpr Bitboard get_rook_attacks(Square, Bitboard)’:
tables.cpp:163:1: error: the value of ‘ROOK_ATTACKS’ is not usable in a constant expression
163 | }
| ^
tables.cpp:116:10: note: ‘ROOK_ATTACKS’ was not declared ‘constexpr’
116 | Bitboard ROOK_ATTACKS[64][4096];
| ^~~~~~~~~~~~
tables.cpp: In function ‘constexpr Bitboard get_bishop_attacks(Square, Bitboard)’:
tables.cpp:229:1: error: the value of ‘BISHOP_ATTACKS’ is not usable in a constant expression
229 | }
| ^
tables.cpp:182:10: note: ‘BISHOP_ATTACKS’ was not declared ‘constexpr’
182 | Bitboard BISHOP_ATTACKS[64][512];
| ^~~~~~~~~~~~~~
tables.cpp: In function ‘void initialise_pseudo_legal()’:
tables.cpp:284:2: error: ‘memcpy’ was not declared in this scope
284 | memcpy(PAWN_ATTACKS[WHITE], WHITE_PAWN_ATTACKS, sizeof(WHITE_PAWN_ATTACKS));
| ^~~~~~
tables.cpp:2:1: note: ‘memcpy’ is defined in header ‘’; did you forget to ‘#include ’?
1 | #include "tables.h"
+++ |+#include
2 | #include "types.h"
In file included from tables.h:3,
from tables.cpp:1:
types.h: At global scope:
types.h:109:22: warning: inline function ‘Square pop_lsb(Bitboard*)’ used but never defined
109 | extern inline Square pop_lsb(Bitboard* b);
| ^~~~~~~
types.h:107:19: warning: inline function ‘int pop_count(Bitboard)’ used but never defined
107 | extern inline int pop_count(Bitboard x);
| ^~~~~~~~~
types.cpp: In function ‘constexpr Square bsf(Bitboard)’:
types.cpp:127:1: error: the value of ‘DEBRUIJN64’ is not usable in a constant expression
127 | }
| ^
types.cpp:104:11: note: ‘DEBRUIJN64’ was not declared ‘constexpr’
104 | const int DEBRUIJN64[64] = {