delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/04/28/22:22:40

X-Spam-Check-By: sourceware.org
Message-ID: <20060429022227.15207.qmail@web35715.mail.mud.yahoo.com>
Date: Fri, 28 Apr 2006 19:22:27 -0700 (PDT)
From: TV JOE <osastw AT yahoo DOT com>
Subject: Compiling with gettimeofday
To: cygwin AT cygwin DOT com
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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(&ltim, 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019