Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Problem compiling TBGEN from crafty ftp

Author: Lenard Spencer

Date: 17:04:26 01/29/01

Go up one level in this thread


On January 28, 2001 at 09:59:02, Dieter Buerssner wrote:

>On January 28, 2001 at 09:03:15, Frank Phillips wrote:
>
>>On January 26, 2001 at 16:31:38, Lenard Spencer wrote:
>>
>>>Maybe someone can help me.  I have been trying to compile TBGEN on my Linux
>>>system (P1MMX/200 running Mandrake 7.0).  I use the command line given in the
>>>readme.txt but get a couple warnings and then it exits out without producing any
>>>executable.  Anything special I need to know here?  (No problems on my Win32
>>>box.)
>
>>Pretty vague recollection of the details, but I remember having to re cast a
>>variable (to the same type) due to it being previously defined as const but then
>>assigned another value.  After this, tbgen compiled under Mandrake 7.1.
>
>This rang a bell. I had to do the same. Here is the diff to the original
>source.
>
>E:\egtb>diff -u tbgen.cpp tbgen.bak
>--- tbgen.cpp   Sun Jun 18 00:45:38 2000
>+++ tbgen.bak   Sun Dec 13 15:43:04 1998
>@@ -2445,7 +2445,7 @@
>        // Create files
>        for (sd = x_colorWhite; sd <= x_colorBlack; sd = (color) (sd + 1))
>                {
>-               char    *pchExt = (char *)PchExt (sd); // buers
>+               char    *pchExt = PchExt (sd);
>
>                VTab (iLevel);
>                printf ("  %s %s: Creating file\n", pchTable, PchTm (sd));
>
>Which means, that you have to add (char *) in line 2445. The reason is,
>that in C++, it is illegal to assign (const char *) to (char *) without
>cast. In general, it is of course also risky, but I think I checked this
>case, and there is no problem here, because nothing is written to pchExt.
>The better fix might be to change "char *pchExt" to "const char *pchExt",
>but I did not try it.
>
>Regards,
>Dieter

Thanks, that did the trick.  I did get a warning on the Linux box in one routine
about "gets" is dangerous and should not be used, but it seems to be generating
the files fine so far.  I'll let you know.



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.