how to compile this simple program???
From: David (dz1976_at_hotmail.com)
Date: 08/27/03
- Next message: Adam Fineman: "Re: how to compile this simple program???"
- Previous message: Kevin Krammer: "Re: Qt and automake"
- Next in thread: Adam Fineman: "Re: how to compile this simple program???"
- Reply: Adam Fineman: "Re: how to compile this simple program???"
- Reply: Ulrich Eckhardt: "Re: how to compile this simple program???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Aug 2003 13:00:35 -0700
i am trying to compile the following with gcc on a RH 9.0 box:
#include <sys/types.h>
#include <sys/resource.h>
#include <sys/time.h>
#include <unistd.h>
#include <stdio.h>
/* resource.c */
int main(int argc,char* argv[]){
struct rusage r_usage;
struct rlimit r_limit;
getrusage(RUSAGE_SELF, &r_usage);
printf("User: %ld.%06ld\n",r_usage.ru_utime.tv_sec,
r_usage.ru_utime.tv_usec);
getrlimit(RLIMIT_FSIZE,&r_limit);
printf("Current FSIZE limit: soft = %ld, hard = %ld\n",
r_limit.rlim_cur,r_limit.rlim_max);
return 0;
}
with:
gcc -o resource resource.c
but it came back with the error that says 'struct rusage r_usage' is
undeclared (it also complain about 'struct rlimit'). i am sure that i
have missed something so gcc is not able to find the definition of the
rusage strrct but since this is the first time i am trying to program
in linux, i don't know how to solve that. i have googled around for a
while with no avil. can someone tell me what's wrong? thanks!
- Next message: Adam Fineman: "Re: how to compile this simple program???"
- Previous message: Kevin Krammer: "Re: Qt and automake"
- Next in thread: Adam Fineman: "Re: how to compile this simple program???"
- Reply: Adam Fineman: "Re: how to compile this simple program???"
- Reply: Ulrich Eckhardt: "Re: how to compile this simple program???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|