Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jun 2007 13:54:34 -0700
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Craig Rodrigues <rodrigc@crodrigues.org>
Cc:        deischen@freebsd.org, freebsd-current@freebsd.org, davidxu@freebsd.org
Subject:   Re: Undefined symbol timer_delete()?
Message-ID:  <20070616205434.GA26966@troutmask.apl.washington.edu>
In-Reply-To: <20070616203624.GA37899@crodrigues.org>
References:  <20070616203624.GA37899@crodrigues.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070616205434.GA26966>