167) What order should the libraries be linked in?

[Last modified: August 92]

Answer: At link time, use the library order  -lXm -lXt -lX11. There are two
reasons for this (dbrooks@osf.org):

On most systems, the order matters because the linker won't re-scan a library
once it is done with it.  Thus any references to Xlib calls from Xm will
probably be unresolved.

The [other] problem is that there are two VendorShell widgets. A dummy is
provided in the Xt library, but a widget set will rely on its own being
referenced.  If you mention Xt first, the linker will choose the wrong one.

Motif code will wrongly assume the Motif VendorShell has been class-
initialized [and will probably crash].
 Xaw has a similar problem, but a softer landing; it only complains about
unregistered converters.
Go Back Up

Go To Previous

Go To Next