public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Compiling gnuchess under gnu-win32
@ 1998-12-31  8:13 Kent Perrier
  1999-01-31 23:52 ` Compiling gnuchess under gnu-win32 [Solution] Kent Perrier
  0 siblings, 1 reply; 3+ messages in thread
From: Kent Perrier @ 1998-12-31  8:13 UTC (permalink / raw)
  To: gnu-win32

Has anyone compiled gnuchess under gnu-win32?  After I modified the
makefile to look in /usr/local/include (so it can find curses.h)
everything compiles fine until it comes to gnuan.c
I get these two errors:

./gnuan.c: In function 'InputCommand':
./gnuan.c:1727: too few arguments to function `difftime'
make: *** [gnuan.o] Error 1
/home/gnuchess-4.0pl79/src$

If someone can help me out I would appreciate it!  I running cygwin32
b20.1 on a Win95 OSR2
laptop.

Thanks and have a Happy New Year!

Kent
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Compiling gnuchess under gnu-win32 [Solution]
  1998-12-31  8:13 Compiling gnuchess under gnu-win32 Kent Perrier
@ 1999-01-31 23:52 ` Kent Perrier
  1999-01-31 23:52   ` Mumit Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Kent Perrier @ 1999-01-31 23:52 UTC (permalink / raw)
  To: gnu-win32

Kent Perrier wrote:
> 
> Has anyone compiled gnuchess under gnu-win32?  After I modified the
> makefile to look in /usr/local/include (so it can find curses.h)
> everything compiles fine until it comes to gnuan.c
> I get these two errors:
> 
> ./gnuan.c: In function 'InputCommand':
> ./gnuan.c:1727: too few arguments to function `difftime'
> make: *** [gnuan.o] Error 1
> /home/gnuchess-4.0pl79/src$
> 

The following fix was sent to me by Dr. Volker Zell.  It appears to fix
the problem.  The compile
is running right now and it is building its opening book database.

#ifndef __CYGWIN__
    elapsed_time = difftime(end_time - start_time);
    fprintf (fpout, "\n           Elapsed time was %ld seconds.\n",
elapsed_time);
#else
    fprintf (fpout, "\n           Elapsed time is missing in
CYGWIN.\n");
#endif

Kent
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Compiling gnuchess under gnu-win32 [Solution]
  1999-01-31 23:52 ` Compiling gnuchess under gnu-win32 [Solution] Kent Perrier
@ 1999-01-31 23:52   ` Mumit Khan
  0 siblings, 0 replies; 3+ messages in thread
From: Mumit Khan @ 1999-01-31 23:52 UTC (permalink / raw)
  To: Kent Perrier; +Cc: gnu-win32

Kent Perrier <kent.perrier@pgs.com> writes:
> Kent Perrier wrote:
> > 
> > Has anyone compiled gnuchess under gnu-win32?  After I modified the
> > makefile to look in /usr/local/include (so it can find curses.h)
> > everything compiles fine until it comes to gnuan.c
> > I get these two errors:
> > 
> > ./gnuan.c: In function 'InputCommand':
> > ./gnuan.c:1727: too few arguments to function `difftime'
> > make: *** [gnuan.o] Error 1
> > /home/gnuchess-4.0pl79/src$

Gnuchess is using some non-standard version of difftime! The real
fix is to fix gnuchess.

>    elapsed_time = difftime(end_time - start_time);
>    fprintf (fpout, "\n           Elapsed time was %ld seconds.\n",

This is not the definition of ANSI difftime. Unless ANSI has changed
from my copy (I don't have a c9x handy here):

      difftime()        Return the difference in seconds between two
                        calendar times: time1 - time0.

Note the *two* arguments.

Cygwin difftime works just fine. Try the following code (it should print 
something close to 5.0). 

  #include <stdio.h>
  #include <unistd.h>
  #include <time.h>

  int main () {
    time_t time0, time1;
    double delta_t;
    time0 = time (0);
    
    sleep (5);
    
    time1 = time (0);
    
    delta_t = difftime (time1, time0);
    printf ("delta time = %f\n", delta_t);
    return 0;
  }

$ gcc -Wall -o difftime difftime.c
$ ./difftime
delta time = 5.000000

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-01-31 23:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-31  8:13 Compiling gnuchess under gnu-win32 Kent Perrier
1999-01-31 23:52 ` Compiling gnuchess under gnu-win32 [Solution] Kent Perrier
1999-01-31 23:52   ` Mumit Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).