This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Compiling with gettimeofday
- From: TV JOE <osastw at yahoo dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 28 Apr 2006 19:22:27 -0700 (PDT)
- Subject: Compiling with gettimeofday
i,
I've a program written for SUSE linux. The compile fails at the same
place each time while referencing gettimeofday. I compile like this
gcc -I/usr/include/mingw -I/usr/include/mingw/sys GoCart_v04.c -lm
I compile with and without the -I included dirs and still have the
problem.
At compile I get this error message.
v04.c: In function `gettime':
v04.c:196: error: storage size of 'ltim' isn't known
Here is funtion gettime.
/********************************************************************/
// Functions start here.
/********************************************************************/
// Function to read system time. Only used for testing execution speed.
long int gettime(void)
{
struct timeval ltim;
gettimeofday(<im, NULL);
return (((long int)ltim.tv_sec)*((long int)(1000000))+((long
int)ltim.tv_usec));
}
My includes at the top of the
source code are as below.
// Inclusions
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <complex.h>
I've tried replacing time.h with unistd.h or including
sys/time.h after time.h. Any advice is welcome.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/