On Thu, 20 Jan 2000, Ronald van Loon wrote: > This is not true. Direct dependencies and the libraries needed for > compiling are two different things. Unless the linker has become > extremely smart, it is still necessary to specify all libraries a
No, this is wrong. With dynamic linking it is proper to specify ONLY the libraries whos functions you explicitly use. For instance if you only call imlib functions then you should link only to imlib. In turn, imlib's shared library can link to or dlopen whatever other shared libraries it requires. Try running ldd on a shared object and you can see this, for instance, b54pc18{jgg}~#ldd /usr/lib/libgtk.so libgmodule-1.2.so.0 => /usr/lib/libgmodule-1.2.so.0 (0x40124000) libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x40127000) libdl.so.2 => /lib/libdl.so.2 (0x40149000) libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x4014d000) libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40159000) libm.so.6 => /lib/libm.so.6 (0x401fd000) libc.so.6 => /lib/libc.so.6 (0x40219000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000) For dynamic libraries you should be able to link with a minimal set of libraries, ie to use GTK you should not need to include X libraries (unless you use X calls) and so on. *static* libraries are conisiderably different and in that case you do need to mention all of the libraries that all of the sub libraries touch. However, I thought gnome used libtool which takes care of that through its .la files, making this whole point moot. Jason