在Linux上编译调用POSIX定时器函数的程序(例如:timer_create,timer_settime)会返回错误,例如:
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
我需要链接哪个库?
用-lrt
选项编译它.它会被编译.