On 04/10/2012 02:20 PM, Sampsa Laine wrote:
(Oleg, others correct me if I'm wrong)
I think -lpcap tells it to dynamically link to the libpcap.so lib, so
the code is not included in the output executable.
Not quite...-lpcap tells the linker to look for *either* a static or a
dynamic library, whichever it's able to find.
Then at runtime the system searches the library search path for the
.so (set by an env var, can't recall precise name) and loads the code
from there.
This is OS-dependent, but it's usually LD_LIBRARY_PATH. Some OSs have
a system-wide configuration for that (Solaris has the "crle" system for
example) which can then be overridden by the environment variable.
-Dave
--
Dave McGuire, AK4HZ
New Kensington, PA