Cook Book: Compile Crafty Chess Engine with gcc under Windows

Question:

Why is a modified file "X86.s" used for compiling version 19.7 (and some versions after) with Dev-C++ (gcc/g++/as) ?

Answer:

When compiling these Crafty versions with the original "X86.s", then I get linking errors like these: Q.: This did not occur in v. 19.6! What has changed in the new versions?

A.: In the "X86.s" of version 19.6, some label names like "FirstOne" or "PopCnt" are preceeded by "_" underscores. In versions 19.7 (and later) these underscores have been removed. As a consequence, the names somehow conflict with other parts of the C- source code where the same names are used. This yields linking errors when compiling with Dev-C++ 4.9.8.5 (gcc 3.2 / g++ 3.2 / as 2.13.90).
Therefore, I have re-introduced the underscores, in the same way as it was already the case in the X86.s of version 19.6. That's all, no further changes have been made.

→ Now, the compilation works without any problems !

The picture below shoes in which way the original X86.s of crafty 19.7 differs from the modified version: