Re: Undefined symbol timer_delete()?

From: Steve Kargl <sgk_at_troutmask.apl.washington.edu>
Date: Sat, 16 Jun 2007 13:54:34 -0700
On Sat, Jun 16, 2007 at 04:36:24PM -0400, Craig Rodrigues wrote:
> Hi,
> 
> I was in the middle of updating the xfsprogs port
> when I got a linker problem related to timer_delete(2).
> 
> I just tried to compile the following program:
> 
> #include <time.h>
> int main(void) {
>   timer_t timerid;
>   timer_delete(timerid);
>   return 0;
> }
> 
> and got this linker error:
> /var/tmp//ccBspzgp.o(.text+0x18): In function `main':
> : undefined reference to `timer_delete'
> 
> According to the timer_delete(2) man page, this symbol should be in libc,
> but I can't link to it.
> 
> Any ideas what is going on?
> 

You failed to include the actual command you used to compile
your program.  So, I'm guessing pilot error.

mobile:kargl[203] cat > j.c
#include <time.h>
int main(void) {
  timer_t timerid;
  timer_delete(timerid);
  return 0;
}
mobile:kargl[204] cc -o z j.c
/tmp/ccisiugw.o(.text+0x18): In function `main':
: undefined reference to `timer_delete'
mobile:kargl[205] cc -o z j.c -lrt

It appears that the manpage is wrong

LIBRARY
     Standard C Library (libc, -lc)

Hint:
(cd /usr/src/lib ; find . -name \*.map | xargs grep timer)

-- 
Steve
Received on Sat Jun 16 2007 - 18:55:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:12 UTC