Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Trying to compile Gerbil with gcc

Author: Dann Corbit

Date: 13:06:48 12/17/01

Go up one level in this thread


On December 16, 2001 at 08:13:26, James Swafford wrote:

>On December 15, 2001 at 22:21:37, Bruce Moreland wrote:
>
>>On December 15, 2001 at 21:36:42, Jeff Lischer wrote:
>>
>>>For fun, I've been trying to compile Bruce Moreland's Gerbil. I'm using the
>>>mingw32 gcc on windows. Now I see that the Gerbil makefile is set up for nmake
>>>and cl.exe.
>>>
>>>Does anyone know if there is a makefile for gcc that I can use instead? If not,
>>>are there any other ways to try compiling it in gcc?
>>
>>No.  Someone sent me email telling me that they were doing this, but I don't
>>know if they necessarily got it working.
>>
>>There are two targets, gerbil.exe and epd2wb.exe.
>>
>>epd2wb.exe is build from epd2wb.c and answer.c, with just a normal console
>>program compile.
>>
>>gerbil.exe is built from everything in the winboard subdirectory and everything
>>in the engine subdirectory, same thing.
>>
>>There could be a small problem with __int64, which I use, and which could be
>>replaced by "long long" under Gnu.  Gnu might also get mad about my "//" style
>>comments.
>>
>
>I can confirm that... I do this:
>
>#ifdef MSVC
>typedef unsigned __int64 Bitmap;
>#else
>typedef long long Bitmap;
>#endif
>
>
>I don' think gcc cares about " // ", but I'm actually using g++ now,
>so I can't remember for sure.

For C code, it's an error (won't even produce an object).  For C++ code, it's
not a problem (of course).

dcorbit@DANNFAST c:/tmp
$ cat foo.c
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
int main(void)
{
   srand((unsigned)time(NULL));
   // pseudo-random number
   printf("%d\n", rand());
   return 0;
}

dcorbit@DANNFAST c:/tmp
$ gcc -Wall -ansi -pedantic -O3 foo.c
foo.c: In function `main':
foo.c:7: parse error before `/'

dcorbit@DANNFAST c:/tmp
$ cat foo.cc
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
int main(void)
{
   srand((unsigned)time(NULL));
   // pseudo-random number
   printf("%d\n", rand());
   return 0;
}

dcorbit@DANNFAST c:/tmp
$ gcc -Wall -ansi -pedantic -O3 foo.cc

dcorbit@DANNFAST c:/tmp
$ ./a
1370013620

dcorbit@DANNFAST c:/tmp
$ ./a
1520344124

dcorbit@DANNFAST c:/tmp
$



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.