From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: Re: Compiling gnuchess under gnu-win32 [Solution] 6 Jan 1999 02:28:40 -0800 Message-ID: <199901060138.TAA04641.cygnus.gnu-win32@modi.xraylith.wisc.edu> References: <369231B9 DOT FFB7D21C AT pgs DOT com> To: Kent Perrier Cc: "gnu-win32 AT cygnus DOT com" Kent Perrier 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 #include #include 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 AT cygnus DOT com" with one line of text: "help".