In computing, Motif refers to both a graphical user interface (GUI) specification and the widget toolkit for building applications that follow that specification under the X Window System on Unix and other POSIX-compliant systems. It emerged in the 1980s as Unix workstations were on the rise, as a competitor to the OPEN LOOK GUI. It is now the basic building block of the Common Desktop Environment.


First, some history: Solaris 2.3 did not come with Motif. So we purchased a small number of Motif licenses from a company called BlueStone. Their Motif is version 1.2.4, and is installed in /util/X11 with the rest of the X libraries. It also came with a version of mwm (the Motif window manager), but it does not seem to work correctly. It is available on all CSE Solaris 2.x hosts, but is not the preferred set of Motif libraries to use.

Solaris 2.4 and later come with the Motif libraries, but not with mwm. (Solaris 2.5 and later come with dtwm, the CDE window manager, which is based on Motif.)

Motif resides in the CDE tree: /usr/dt/ (presumably "dt" stands for "DeskTop".) This is currently version 1.2.7 of Motif. All public CSE departmental Suns are currently running Solaris 2.8 or later.

So, which Motif should you use? Almost definitely use the /usr/dt/ stuff. It is more standard, and, if you distribute/give your program to anyone else, it will work on their Solaris 2.x system without modification.

To use the stuff in /usr/dt, you need to also use the regular X libraries from /usr/openwin, as described above, plus the Motif libraries. So, your Motif compile lines need:

-I/usr/dt/include -I/usr/openwin/include

... and your link line needs:

-L/usr/dt/lib -L/usr/openwin/lib -R/usr/dt/lib:/usr/openwin/lib -lXm -lXt -lSM -lICE -lX11 -lsocket -lnsl -lgen

The most current version of Motif is Motif 2.0, but we do not have it installed anywhere.

We do not have working Imake templates for Motif. So "xmkmf" will not work on most Motif programs.

Whichever Motif you use, be sure to put the -lXm before the -lXt, otherwise the program will dump core when you run it.