justNo4b / Drofa

UCI chess engine
GNU General Public License v3.0
46 stars 7 forks source link

I can't compile it #206

Open SzotsGabor opened 2 years ago

SzotsGabor commented 2 years ago

I could compile version 3.3.0 without problems but now I am stuck with 3.3.22. Here is what I get using the Makefile (I have gcc 12.2.0):

In file included from src/bitbase.cc:2: src/endgame.h:65:8: error: 'uint' does not name a type; did you mean 'int'? 65 | inline uint kpk_get_index(Color, int, int, int); | ^~~~ | int src/endgame.h:70:29: error: 'uint' has not been declared 70 | void kpk_set(kpk_position, uint); | ^~~~ src/bitbase.cc:14:8: error: 'uint' does not name a type; did you mean 'int'? 14 | inline uint Bitbase::kpk_get_index(Color color, int bKing, int wKing, int pawn){ | ^~~~ | int src/bitbase.cc: In function 'bool Bitbase::kpk_is_winning(Color, int, int, int)': src/bitbase.cc:20:5: error: 'uint' was not declared in this scope; did you mean 'int'? 20 | uint index = kpk_get_index (color, bKing, wKing, pawn); | ^~~~ | int src/bitbase.cc:21:25: error: 'index' was not declared in this scope 21 | return (KPK_Bitbase[index >> 3] & (1 << (index & 7))); | ^~~~~ src/bitbase.cc: At global scope: src/bitbase.cc:24:48: error: 'uint' has not been declared 24 | void Bitbase::kpk_set(kpk_position bPosition, uint index){ | ^~~~ src/bitbase.cc: In function 'void Bitbase::kpk_classify(kpk_position, kpk_position)': src/bitbase.cc:83:29: error: 'kpk_get_index' was not declared in this scope 83 | result |= table[kpk_get_index(BLACK, bksq, _popLsb(b), psq)].result; | ^~~~~ src/bitbase.cc:85:29: error: 'kpk_get_index' was not declared in this scope 85 | result |= table[kpk_get_index(WHITE, _popLsb(b), wksq, psq)].result; | ^~~~~ src/bitbase.cc:96:29: error: 'kpk_get_index' was not declared in this scope 96 | result |= table[kpk_get_index(BLACK, bksq, wksq, psq + 8)].result; | ^~~~~ src/bitbase.cc:101:29: error: 'kpk_get_index' was not declared in this scope 101 | result |= table[kpk_get_index(BLACK, bksq, wksq, psq + 8 + 8)].result; | ^~~~~ src/bitbase.cc: In function 'void Bitbase::init_kpk()': src/bitbase.cc:120:5: error: 'uint' was not declared in this scope; did you mean 'int'? 120 | uint index; | ^~~~ | int src/bitbase.cc:124:10: error: 'index' was not declared in this scope 124 | for (index = 0; index < KPK_SIZE; ++index) kpk_set(kpkTable + index, index); | ^~~~~ src/bitbase.cc:128:14: error: 'index' was not declared in this scope 128 | for (index = 0; index < KPK_SIZE; ++index) | ^~~~~ src/bitbase.cc:137:10: error: 'index' was not declared in this scope 137 | for (index = 0; index < KPK_SIZE; ++index) | ^~~~~ mingw32-make: *** [Makefile:43: obj/bitbase.o] Error 1

justNo4b commented 2 years ago

Thank you. I am aware of this issue. In my nix machine I can use uint instead of unsigned int, but it may cause issues this issues sometimes.

I`ll notify here when I fix this (should be soon)

SzotsGabor commented 2 years ago

I have changed all uint occurrences in endgame.h and bitbase.cc to unsigned int and now compilation is successful.

justNo4b commented 1 year ago

Likely fixed with 577a294 , but cant check now. Will close once I am 100% sure it is fixed

SzotsGabor commented 1 year ago

Hi Alexander,

Thanks for 4.0.0. Please note that it displays 3.3.27 as version number.

Also, again I have difficulties with compiling. This is how the error message starts:

In file included from src/bitbase.cc:19: src/endgame.h:55:5: error: 'uint8_t' does not name a type 55 uint8_t result; ^~~ src/endgame.h:24:1: note: 'uint8_t' is defined in header ''; did you forget to '#include '? 23 #include "bitutils.h" +++ +#include 24 src/bitbase.cc:25:1: error: 'uint8_t' does not name a type 25 uint8_t KPK_Bitbase[KPK_SIZE / 8]; ^~~ src/bitbase.cc:24:1: note: 'uint8_t' is defined in header ''; did you forget to '#include '? 23 #include +++ +#include 24 src/bitbase.cc: In function 'bool Bitbase::kpk_is_winning(Color, int, int, int)': src/bitbase.cc:38:13: error: 'KPK_Bitbase' was not declared in this scope; did you mean 'Bitbase'? 38 return (KPK_Bitbase[index >> 3] & (1 << (index & 7))); ^~~ Bitbase src/bitbase.cc: In function 'void Bitbase::kpk_set(kpk_position*, unsigned int)': src/bitbase.cc:59:20: error: 'struct kpk_position' has no member named 'result' 59 bPosition->result = KPK_INVALID;

etc.

EDIT: I have similar problem with uint16_t.

tissatussa commented 1 year ago

@SzotsGabor

..I have difficulties with compiling..

i'm on Xubuntu 22.04 here and all went well : no compile errors nor warnings .. indeed the version number is 3.3.27 after 'uci'.

SzotsGabor commented 1 year ago

@SzotsGabor

..I have difficulties with compiling..

i'm on Xubuntu 22.04 here and all went well : no compile errors nor warnings .. indeed the version number is 3.3.27 after 'uci'.

I think my problem is similar to what I have described above and solved as well but this time instead of 'uint' I have uint8_t and uint16_t and I don't know what to do with them. I am on Windows 11 and use the latest gcc compiler.

Gabor

justNo4b commented 1 year ago

@SzotsGabor

..I have difficulties with compiling..

i'm on Xubuntu 22.04 here and all went well : no compile errors nor warnings .. indeed the version number is 3.3.27 after 'uci'.

I think my problem is similar to what I have described above and solved as well but this time instead of 'uint' I have uint8_t and uint16_t and I don't know what to do with them. I am on Windows 11 and use the latest gcc compiler.

Gabor

You can try #include <stdint.h> in problem files. On all of my machines it happens automatically, but not on yours, it seems. Please write if it helps, I`ll update the release

SzotsGabor commented 1 year ago

You can try #include <stdint.h> in problem files. On all of my machines it happens automatically, but not on yours, it seems. Please write if it helps, I`ll update the release

Yes, it helped, thank you.