Libraries usually depend on other libraries. Let's say libxyz.so depends on libz.so you have to specify both libraries when linking (g++ -o prog *.o -lxyz -lz).
If you do not specify all libraries, the linker will complain that symbols referenced in libxyz cannot be found. You can use the ldd command to understand what libraries libxyz.so depends on:
So libpng12 depends on libz (and the standard libraries libc and libm).Code:treuss>ldd /usr/lib/libpng12.so.0 libz.so.1 => /usr/lib/libz.so.1 (0xb7fa6000) libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7f7f000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e3d000)




Reply With Quote