GNU linker
Arun Saini , Gurgaon
arun@ggn.hcltech.com
Mon Feb 18 12:13:00 GMT 2002
>How do ld know which library to load for an application?
It doesn't. It searches for undefined symbols in libraries specified to it,
in the order in which they are specified (searching iteratively if
required).
>Many applications using sockets run the socket-code from libc,
>but if the application is using pthreads, it will need to use
>the socket-calls in libpthread. How does ld know which library to
>choose?
Specify -lpthread on the command line while linking the executable. Actually
you need to place it before -lc which if not specified explicitly occurs
after the user specified libraries in the search order.
More information about the Gcc
mailing list