Identifying the libraries in a program

The libraries that are included in a program can usually be identified by the GUI that is presented to the user. Another way to determine which libraries are being used is to use the command ldd(1).

ldd

Ldd is a utility for displaying the shared libraries that will be used by an executable.

$ ldd /usr/bin/X11/xclock
dynamic linker: /usr/bin/X11/xclock: file loaded: /usr/lib/libXaw.so.5.0
dynamic linker: /usr/bin/X11/xclock: file loaded: /usr/lib/libXmu.so.5.0
dynamic linker: /usr/bin/X11/xclock: file loaded: /usr/lib/libXt.so.5.0
dynamic linker: /usr/bin/X11/xclock: file loaded: /usr/lib/libXext.so.5.0
dynamic linker: /usr/bin/X11/xclock: file loaded: /usr/lib/libX11.so.5.0
dynamic linker: /usr/bin/X11/xclock: file loaded: /usr/lib/libnsl.so
dynamic linker: /usr/bin/X11/xclock: file loaded: /usr/lib/libc.so.1

$ ldd /usr/bin/X11/xterm
dynamic linker: /usr/bin/X11/xterm: file loaded: /usr/lib/libX11.so.5.0
dynamic linker: /usr/bin/X11/xterm: file loaded: /usr/lib/libnsl.so
dynamic linker: /usr/bin/X11/xterm: file loaded: /usr/lib/libc.so.1

$ ldd /usr/bin/X11/mwm
dynamic linker: /usr/bin/X11/mwm: file loaded: /usr/lib/libXm.so.1.1
dynamic linker: /usr/bin/X11/mwm: file loaded: /usr/lib/libXt.so.5.0
dynamic linker: /usr/bin/X11/mwm: file loaded: /usr/lib/libXext.so.5.0
dynamic linker: /usr/bin/X11/mwm: file loaded: /usr/lib/libX11.so.5.0
dynamic linker: /usr/bin/X11/mwm: file loaded: /usr/lib/libc.so.1
dynamic linker: /usr/bin/X11/mwm: file loaded: /usr/lib/libnsl.so

version numbers

The following table summarizes the version numbers used to distinguish different release of the X libraries. This numbering system is a convention adopted for use with the iABI.
.TS
center;
lb lb
l l.
Library Meaning
_
libX11.so.1     X11R3 Xlib
libX11.so.4.0   X11R4 Xlib
libX11.so.5.0   X11R5 Xlib
libXt.so.1      X11R3 X Toolkit
libXt.so.4.0    X11R4 X Toolkit
libXt.so.5.0    X11R5 X Toolkit
libXm.so.1.1    Motif 1.1 widget library
libXm.so.1.2    Motif 1.2 widget library
.TE
.P
The other X libraries have similar conventions for their version numbering.