LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   a problem with libgtop (https://www.linuxquestions.org/questions/linux-software-2/a-problem-with-libgtop-233569/)

wangjinyi 09-21-2004 07:28 PM

a problem with libgtop
 
I do something like this:
Code:

int main(void)
{
        glibtop_cpu myCpu;
        glibtop_init();
        glibtop_get_cpu(&myCpu);
        printf("total:%d\nuser:%d\nnice:%d\nsys:%d\nidle:%d\nfrequency:%d\n",
                myCpu.total, myCpu.user, myCpu.nice, myCpu.sys, myCpu.idle,myCpu.frequency);
        return(0);
}

and when compile:

g++ -g -I. -I/usr/include myglibtop.cpp -o myglibtop -L. -L/usr/lib -lgtop
-lgtop_sysdeps -lgtop_common
/tmp/ccoRbj6c.o(.text+0x20): In function `main':
/home/jywang/myExam/glibtop/myglibtop.cpp:9: undefined reference to
`glibtop_init_r(_glibtop**, unsigned long, unsigned)'
collect2: ld returned 1 exit status
make: *** [all] Error 1

why?

do you have some examples?

email:jywang@cnic.cn

sudevank 07-17-2007 07:59 AM

i also got the same problem. but after commenting out ligtop_init() it worked fine
any new ideas??


All times are GMT -5. The time now is 12:45 AM.