This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: help on a compiling on linux machine
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: yuwb <yuwb_personal at yahoo dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 29 Feb 2012 18:18:28 +0000
- Subject: Re: help on a compiling on linux machine
- Authentication-results: mr.google.com; spf=pass (google.com: domain of jwakely.gcc@gmail.com designates 10.152.130.102 as permitted sender) smtp.mail=jwakely.gcc@gmail.com; dkim=pass header.i=jwakely.gcc@gmail.com
- References: <33415964.post@talk.nabble.com>
On 29 February 2012 18:06, yuwb <yuwb_personal@yahoo.com> wrote:
>
> I am compiling a code named ?http://old.nabble.com/file/p33415964/timers.c
> timers.c ?out of the metis package, it includes a header file
> http://old.nabble.com/file/p33415964/GKlib.h GKlib.h . ?On PC windows 7, I
> have no problem compiling it. However, on linux, I am getting the following
> error message:
>
> timers.c: In function gk_CPUSeconds:
> timers.c:45:19: error: storage size of r isn't known
> timers.c:47:15: error: RUSAGE_SELF undeclared (first use in this function)
>
> I am using gcc version 4.7.0 20110416 (experimental). Please help me figure
> out what is wrong?
The code probably fails to include the necessary headers that define
RUSAGE_SELF.
You need
#include <sys/time.h>
#include <sys/resource.h>