Ever wanted to know the library dependencies of a program ? ? ?
Since I was configuring Apache2.x in my box and had some troubleshooting because of my initial setup, I just wanted to know which libraries my already installed Apache depends. This is when I learned about the powerfull “ldd” command. (This is in Linux)
“ldd” command shows the shared library dependencies of a program.
My sample is as follows:
prabhugnanasundar@prabhugnanasundar:~$ ldd /usr/local/apache2/bin/httpd
linux-gate.so.1 => (0xb7ef8000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7ec2000)
libaprutil-1.so.0 => /usr/local/apache2/lib/libaprutil-1.so.0 (0xb7ea5000)
libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0xb7e7e000)
libapr-1.so.0 => /usr/local/apache2/lib/libapr-1.so.0 (0xb7e57000)
librt.so.1 => /lib/i686/cmov/librt.so.1 (0xb7e4e000)
libcrypt.so.1 => /lib/i686/cmov/libcrypt.so.1 (0xb7e1c000)
libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb7e03000)
libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7dfe000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7cb7000)
“ldd” was really handy in helping me figure out the dependent libraries of the httpd
NOTE: ldd does not work on a.out shared libraries.