as the title states..
what is the best way to know which function call belongs to which library?
I was coding in C and using GCC 4.x..
I know how to use System V IPC semaphores..
but I wanted to learn POSIX semaphores..
so i went through some internet tutorials and from manpages I could learn..
but I have no idea which library to link with my object file,
for my code to run.. I searched and searched.. after a long time I found it..
its like '-lrt'.. (no tute specified which lib to link )
so my question is in general how can one find the library to reference?
if I am stuck at such point.. man pages dont tell me which lib does this belong to..
they only tell me the header files..
I found some thread 2 years old on a forum asking to grep on /usr/lib/*
I did it and ended up with lot many results saying few matches found..
and one of them is libgc.. I didnt understand why I should be linking if its in libgc..
Also that grep didnt list 'librt'
can anyone help me?