tags:

views:

1174

answers:

3

Compiling a program on Linux that calls POSIX timer functions (eg: timer_create, timer_settime) returns errors such as:

In function `foo':
timer.c:(.text+0xbb): undefined reference to `timer_create'
timer.c:(.text+0x187): undefined reference to `timer_settime'
collect2: ld returned 1 exit status

Which library do I need to link?

A: 

This should be documented in the man page. Given it isn't add -lrt.

+1  A: 

hey compile it with -lrt option .it will get compiled..

regards, Purushottam kumar

A: 

please: gcc -lrt

dragonfly