Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Compiling TSCP (continue)

Author: Jim Bell

Date: 05:50:59 02/16/03

Go up one level in this thread


On February 16, 2003 at 00:42:42, Joshua Haglund wrote:

>#include "search.c"
>#include "main.c"
>#include "eval.c"
>#include "book.c"
>#include "data.c"
>#include "board.c"
>
>--------------------Configuration: tscp - Win32 Debug--------------------
>Compiling...
>tscp.c
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(22) : error C2061: syntax
>error : identifier 'gen_dat'
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(22) : error C2059: syntax
>error : ';'
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(22) : error C2059: syntax
>error : '['
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(23) : error C2065: 'MAX_PLY'
>: undeclared identifier
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(23) : error C2057: expected
>constant expression
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(23) : error C2466: cannot
>allocate an array of constant size 0
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(25) : error C2061: syntax
>error : identifier 'hist_dat'
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(25) : error C2059: syntax
>error : ';'
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(25) : error C2059: syntax
>error : '['
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(31) : error C2061: syntax
>error : identifier 'pv'
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(31) : error C2059: syntax
>error : ';'
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(31) : error C2059: syntax
>error : '['
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(32) : error C2057: expected
>constant expression
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(32) : error C2466: cannot
>allocate an array of constant size 0
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(33) : error C2061: syntax
>error : identifier 'follow_pv'
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(33) : error C2059: syntax
>error : ';'
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(39) : error C2061: syntax
>error : identifier 'slide'
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(39) : error C2059: syntax
>error : ';'
>c:\windows\desktop\josh\chess\tscp18\tscp18\data.h(39) : error C2059: syntax
>error : '['
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(16) : error C2061: syntax
>error : identifier 'in_check'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(16) : error C2059: syntax
>error : ';'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(16) : error C2059: syntax
>error : 'type'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(17) : error C2061: syntax
>error : identifier 'attack'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(17) : error C2059: syntax
>error : ';'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(17) : error C2059: syntax
>error : 'type'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(22) : error C2061: syntax
>error : identifier 'makemove'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(22) : error C2059: syntax
>error : ';'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(22) : error C2146: syntax
>error : missing ')' before identifier 'm'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(22) : error C2061: syntax
>error : identifier 'm'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(22) : error C2059: syntax
>error : ')'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(29) : error C2061: syntax
>error : identifier 'book_match'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(29) : error C2059: syntax
>error : ';'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(29) : error C2059: syntax
>error : 'type'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(53) : error C2146: syntax
>error : missing ')' before identifier 'm'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(53) : error C2061: syntax
>error : identifier 'm'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(53) : error C2059: syntax
>error : ';'
>c:\windows\desktop\josh\chess\tscp18\tscp18\protos.h(53) : error C2059: syntax
>error : ')'
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(19) : error C2061: syntax
>error : identifier 'stop_search'
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(19) : error C2059: syntax
>error : ';'
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(33) : error C2065: 'pv' :
>undeclared identifier
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(33) : error C2109:
>subscript requires array or pointer type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(33) : error C2109:
>subscript requires array or pointer type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(33) : error C2224: left of
>'.u' must have struct/union type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(34) : error C2109:
>subscript requires array or pointer type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(34) : error C2109:
>subscript requires array or pointer type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(34) : error C2224: left of
>'.u' must have struct/union type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(39) : error C2065:
>'stop_search' : undeclared identifier
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(39) : error C2065: 'FALSE'
>: undeclared identifier
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(55) : warning C4022:
>'memset' : pointer mismatch for actual parameter 1
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(60) : error C2065:
>'follow_pv' : undeclared identifier
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(60) : error C2065: 'TRUE' :
>undeclared identifier
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(69) : warning C4013:
>'move_str' undefined; assuming extern returning int
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(69) : error C2109:
>subscript requires array or pointer type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(69) : error C2109:
>subscript requires array or pointer type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(69) : error C2224: left of
>'.b' must have struct/union type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(84) : error C2065: 'BOOL' :
>undeclared identifier
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(84) : error C2146: syntax
>error : missing ';' before identifier 'c'
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(84) : error C2065: 'c' :
>undeclared identifier
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(84) : error C2065: 'f' :
>undeclared identifier
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(108) : error C2065:
>'HIST_STACK' : undeclared identifier
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(112) : warning C4013:
>'in_check' undefined; assuming extern returning int
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(123) : warning C4013:
>'makemove' undefined; assuming extern returning int
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(123) : error C2065:
>'gen_dat' : undeclared identifier
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(123) : error C2109:
>subscript requires array or pointer type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(123) : error C2224: left of
>'.m' must have struct/union type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(133) : error C2109:
>subscript requires array or pointer type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(133) : error C2224: left of
>'.m' must have struct/union type
>c:\windows\desktop\josh\chess\tscp18\tscp18\search.c(133) : fatal error C1903:
>unable to recover from previous error(s); stopping compilation
>Error executing cl.exe.
>
>tscp.exe - 64 error(s), 4 warning(s)
>
>Can anyone make any sense of this?
>
>I can compile old versions just fine.
>
>Just a simple #include(s) of the .c files and wha-la.
>but not in this case.
>
>MSVC++ 6.0 SE
>
>Joshua
>toneewa@yahoo.com

You are indirectly including multiple copies of other files, such as "defs.h".
The GNU C compiler (GCC) doesn't like your approach either. It works if you
compile each source file separately:

gcc -W -Wall -Werror -fomit-frame-pointer -O3 -c board.c
gcc -W -Wall -Werror -fomit-frame-pointer -O3 -c book.c
gcc -W -Wall -Werror -fomit-frame-pointer -O3 -c data.c
gcc -W -Wall -Werror -fomit-frame-pointer -O3 -c eval.c
gcc -W -Wall -Werror -fomit-frame-pointer -O3 -c main.c
gcc -W -Wall -Werror -fomit-frame-pointer -O3 -c search.c
gcc -o tscp181x.exe board.o book.o data.o eval.o main.o search.o

Jim



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.