I would like to fix the issue described here, and I believe I already know how to fix it, but unfortunately I can no longer compile GiuChess. I remember I could compile it some time ago. I have no idea why I cannot now. Maybe I use a different version of gcc?
rw_thread.c: In function 'wait_for_input':
rw_thread.c:236:3: warning: implicit declaration of function 'xlog'; did you mean 'llog'? [-Wimplicit-function-declaration]
236 | xlog("%s\n", buf);
| ^~~~
| llog
/usr/bin/ld: exec_mov.o:(.bss+0x0): multiple definition of `last_moved_color'; check.o:(.bss+0x0): first defined here
/usr/bin/ld: exec_mov.o:(.bss+0x20): multiple definition of `w'; check.o:(.bss+0x20): first defined here
/usr/bin/ld: exec_mov.o:(.bss+0x2a0): multiple definition of `b'; check.o:(.bss+0x2a0): first defined here
/usr/bin/ld: exec_mov.o:(.bss+0x520): multiple definition of `brow'; check.o:(.bss+0x520): first defined here
/usr/bin/ld: exec_mov.o:(.bss+0x560): multiple definition of `bcol'; check.o:(.bss+0x560): first defined here
...
(I applied to the Makefile the modification described here, but it doesn't solve this problem.)
Could someone help?
Regards.
Roland
Qui trop embrasse mal étreint.
Author of Eschecs, a simple UCI chess GUI written in Pascal.
Thanks Martin. Correction done. But I still get the "multiple definitions" errors.
mar wrote: ↑Sat Jan 15, 2022 9:19 am
also, in the makefile, I've noticed that -O4 and -Wall are only passed when linking, not compiling, so I'd suggest to change the Makefile like this:
ok, the problem seems to be related to the fact, that the engine uses definitions in header files and my gcc version seems to merge those globals internally.
a proper solution would be to use extern in the header files and copy the definitions into c files instead,
piece w[16], b[16]; //w et b sont des piece*
BITMASK brow[8], bcol[8], matrix[8][8];
int arr_row[64], arr_col[64];
BITMASK array[64];
int DEBUGG;
int depthmax;
=> so you can copy this and put it in main.c and add extern prefix to those globals in the header, you may have to do this for multiple files
Would you mind to change the internal name in rw_thread.c now too for differentiating?
BTW did you test if your change works now correctly already?
I compiled it just recently and did that change for my binary. (There were dozens of warnings about unused variables)
BTW what does optimizing level 4? Never used it before.
It seems to work from cmd (played a few blind moves against it):