ricardo13
(usa Fedora)
Enviado em 25/11/2008 - 16:01h
esse é o erro:
[usuariox@localhost examples]$ gcc -Wall -o info info.c -lgtop
info.c:2:21: error: glibtop.h: No such file or directory
info.c:3:25: error: glibtop/cpu.h: No such file or directory
info.c: In function ‘main’:
info.c:11: warning: implicit declaration of function ‘glibtop_init’
info.c:13: error: ‘glibtop_cpu’ undeclared (first use in this function)
info.c:13: error: (Each undeclared identifier is reported only once
info.c:13: error: for each function it appears in.)
info.c:13: error: expected ‘;’ before ‘cpu’
info.c:17: warning: implicit declaration of function ‘glibtop_get_cpu’
info.c:17: error: ‘cpu’ undeclared (first use in this function)
o programa:
#include <stdio.h>
#include <glibtop.h>
#include <glibtop/cpu.h>
#include <glibtop/mem.h>
#include <glibtop/proclist.h>
int main(){
glibtop_init();
glibtop_cpu cpu;
glibtop_mem memory;
glibtop_proclist proclist;
glibtop_get_cpu (&cpu);
glibtop_get_mem(&memory);
printf("CPU TYPE INFORMATIONS \n\n"
"Cpu Total : %ld \n"
"Cpu User : %ld \n"
"Cpu Nice : %ld \n"
"Cpu Sys : %ld \n"
"Cpu Idle : %ld \n"
"Cpu Frequences : %ld \n",
(unsigned long)cpu.total,
(unsigned long)cpu.user,
(unsigned long)cpu.nice,
(unsigned long)cpu.sys,
(unsigned long)cpu.idle,
(unsigned long)cpu.frequency);
return 0;
}
Oq poderia ser ??
Obrigado
Ricardo