Operating System - HP-UX
1753759 Members
4737 Online
108799 Solutions
New Discussion

What is the significances of -lrt while linking

 
nallamolu
Advisor

What is the significances of -lrt while linking

Hi World,

What is the significance of "-lrt" while linking?

I had a problem while doing make for my project
/usr/ccs/bin/ld: Unsatisfied symbols:
sem_post (first referenced in /home/apr-1.3.9/.libs/libapr-1.a(proc_mutex.o)) (code)

This ended with an Error.

When i tried to link with -lrt as the linking option, This has resolved the problem. I don't know why this options has resolved the issue.

Can any one tell the signification of "-lrt" while linking.

Regards,
Gopi

1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: What is the significances of -lrt while linking

>What is the significance of "-lrt" while linking?

This is mentioned in sem_post(2):
To use this function, link in the realtime library by specifying -lrt on the compiler or linker command line.

This links in librt.