Author: Robert Hyatt
Date: 07:45:57 07/18/04
Go up one level in this thread
On July 18, 2004 at 07:10:10, Bryan Hofmann wrote:
>On July 18, 2004 at 01:34:49, Nolan Denson wrote:
>
>>While compiling crafty i get the following error. Does anyone know how to fix
>>this problem.
>>
>>C:\Program Files\Microsoft Visual Studio\MyProjects\Crafty\chess.h(999): error:
>>variable "leftrnd" has already been initialized
>> static int leftrnd = -1; // can *next++ this many times before
>>reloading
>>
>>
>>I may have a few more errors in the future but this is the one that is causing
>>me problems in all three programs Visual Studio 6, 2003 Visual Studio and 2005
>>Visual Studio Express.
>>
>>Thanks
>
>This is Crafty SE and I got the same thing, the issue is Mike choose to place
>this in the chess.h file which in included in almost every other .c file in
>crafty. This can only be initialized once so the best solution is to place all
>of the code at the end of the chess.h file after the
>
>/* if defined(TYPES_INCLUDED) */
>
>in a new .h file for example mb.h . Then in the option.c file add the following;
Put all definitions in data.c. That is where things get initialized. data.h is
included everywhere so a reference to the thing should be included there...
>
>#include "mb.h"
>
>This will fix this problem but there is one other I have not been able to solve
>that deals with the seedMT code that is in the option.c file. I get the error of
>
>c:\devel\Crafty-SE\option.c(6651) : error C2371: 'seedMT' : redefinition; differ
>ent basic types
>c:\devel\Crafty-SE\option.c(6687) : warning C4142: benign redefinition of type
>
>The section of code that is causing this is;
>
>void seedMT (uint32 seed)
> {
> register uint32 x = (seed | 1U) & 0xFFFFFFFFU, *s = state;
> register int j;
> register int k;
> k= ReadClock(time_type);
> x= ((k%2==0) ? k+1 : k) ; // forces an odd number to be the seed
> for(leftrnd=0, *s++=x, j=N; --j;
> *s++ = (x*=69069U) & 0xFFFFFFFFU);
> }
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.