Solaris Common Desktop Environment: Motif Transition Guide

Chapter 2 Motif Environment

This chapter contains information for developers writing Solaris Motif applications for either the OpenWindows or Solaris CDE environment.

Motif Packaging in the Solaris Software

The Motif run-time support in the Solaris 2.6 software includes the following:

The Motif header files required for application development are located in /usr/dt/include. The Motif libraries are located in /usr/dt/lib.

Compiling and Linking Motif Programs

When you compile Motif programs, include the following compiler syntax to enable the compiler to find the Motif and X Window SystemTM header files:

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

Use the following compiler syntax to direct the linker to the correct shared libraries as shown in the following:

-R/usr/dt/lib -R/usr/openwin/lib -L/usr/dt/lib -L/usr/openwin/lib

The following is an example of a compile-and-link line for a Motif application:

cc -o myprog -I/usr/dt/include -I/usr/openwin/include myprog.c -R/usr/dt/lib \ 
-R/usr/openwin/lib -L/usr/dt/lib -lXm -L/usr/openwin/lib -lXt -lX11

Shared Library Policy

SunSoftTM will increment the major version number of each shared Motif library whenever there are binary-incompatible differences from the previous release. SunSoft will make available (either on the Motif distribution or through some other channel) all prior versions of each library. This will ensure that your applications linked with a particular release can continue to run, even after a new Motif release has been installed.