Undefined symbol timer_delete()?

Steve Kargl sgk at troutmask.apl.washington.edu
Sat Jun 16 20:55:19 UTC 2007


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


More information about the freebsd-current mailing list