undefined reference to `clock_nanosleep' 错误

 when i include time.h file(/usr/include/time.h),in my program at compilation time i am getting following messages(errors)

I am expecting solution from u


/tmp/cc61O7TY.o(.text+0x10): In function `wait_code':
: undefined reference to `clock_gettime'
/tmp/cc61O7TY.o(.text+0x24): In function `wait_code':
: undefined reference to `timespec_add_ns'
/tmp/cc61O7TY.o(.text+0x36): In function `wait_code':
: undefined reference to `clock_nanosleep'
/tmp/cc61O7TY.o(.text+0x81): In function `wait_code':
: undefined reference to `clock_gettime'
/tmp/cc61O7TY.o(.text+0xa0): In function `wait_code':
: undefined reference to `timespec_add_ns'
/tmp/cc61O7TY.o(.text+0xb2): In function `wait_code':
: undefined reference to `clock_nanosleep'
/tmp/cc61O7TY.o(.text+0x132): In function `lock_code':
: undefined reference to `clock_gettime'
/tmp/cc61O7TY.o(.text+0x151): In function `lock_code':
: undefined reference to `timespec_add_ns'
/tmp/cc61O7TY.o(.text+0x163): In function `lock_code':
: undefined reference to `clock_nanosleep'
/tmp/cc61O7TY.o(.text+0x209): In function `main':
: undefined reference to `rtl_main_wait'
collect2: ld returned 1 exit status

use "-lrt" to resolve them... (I tried on ubuntu 6.10)

你可能感兴趣的:(function,ubuntu,File,include,reference,compilation)