Author: Daniel Clausen
Date: 04:36:02 07/18/04
Go up one level in this thread
On July 18, 2004 at 05:52:53, Stefano Gemma 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 >[...] > >I don't know Crafty sources, but i think that you can change chess.h this way: > >static int leftrnd; > >and then put in chess.c (or in just one another .c file that include chess.h) >the line: > >static int leftrnd = -1; > >Ciao!!! > >Stefano Gemma I'm not quite sure I understand the whole thing here. Firstly, statics in a headerfile? That's... interesting. :) Since this 'leftrnd' thing seems to be used in multiple .c files (otherwise there's no reason to put it in a .h file), it should be declared as 'extern' in the headerfile. That or I miss something fundamentally here. Sargon
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.