billforsternz / thc-chess-library

General Purpose Rules of Chess Library for C++
MIT License
38 stars 13 forks source link

Compilation errors #8

Closed DSblizzard closed 2 years ago

DSblizzard commented 3 years ago

Win7 x64

G:/Old/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/g++.exe -g demo.cpp thc.cpp -o 1.exe demo.cpp:99:27: warning: trigraph ??! ignored, use -trigraphs to enable [-Wtrigraphs] printf( "Strange(???!), we expected all flags true, meaning both penult imate and final positions are legal, in the final position White is mated\n" );

In file included from demo.cpp:14: thc.h: In member function 'void thc::ChessPosition::Init()': thc.h:337:9: error: 'strcpy_s' was not declared in this scope strcpy_s( squares, sizeof(squares), ^~~~ thc.h:337:9: note: suggested alternative: 'wcscpy_s' strcpy_s( squares, sizeof(squares), ^~~~ wcscpy_s thc.h: In member function 'bool thc::ChessPosition::operator==(const thc::ChessP osition&) const': thc.h:369:22: error: 'memcmp' was not declared in this scope 0 == memcmp( &squares, &other.squares, 64 ) && ^~ thc.h:369:22: note: 'memcmp' is defined in header ''; did you forget to '#include '? thc.h:24:1: +#include

include

thc.h:369:22: 0 == memcmp( &squares, &other.squares, 64 ) && ^~ thc.h: In member function 'bool thc::ChessPosition::operator<(const thc::ChessPo sition&) const': thc.h:394:21: error: 'memcmp' was not declared in this scope int itemp = memcmp( &squares, &other.squares, 64 ); ^~ thc.h:394:21: note: 'memcmp' is defined in header ''; did you forget to '#include '?

spxtr commented 2 years ago

Temporarily fix by importing cstring and changing the strcpy_s to strcpy.

billforsternz commented 2 years ago

I only got around to reproducing this and fixing today, sorry.