Sun Microsystems Logo
Products and Services
 
Support and Training
 
 

Previous Previous     Contents     Index     Next Next
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 runtime support in the Solaris 2.6 software includes the following:

  • Shared libraries

  • Header files

  • Key bindings

  • uil compiler

  • Man pages

  • Demos and sample source

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 System™ 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

Sun will increment the major version number of each shared Motif library whenever there are binary-incompatible differences from the previous release. Sun 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.

Previous Previous     Contents     Index     Next Next
 

Updated: 2003-09-29, 21:37