Compiling the Example Programs

Once you’ve got the examples and unpacked the archive as described above, you’re ready to compile them. The easiest way is to use imake, a program supplied with the X11 distribution that generates proper Makefiles on a wide variety of systems.) imake uses configuration files called Imakefiles which are included. If you have imake, you should go to the top-level directory containing the examples, and type:

% xmkmf
% make Makefiles
% make

All the application-defaults files are in the main examples directory. The application-defaults files are not automatically installed in the system application-defaults directory (usually /usr/lib/X11/app-defaults on UNIX systems). (See Chapter 9, Resource Management and Type Conversion, for details.) If you have permission to write to that directory, you can copy them there yourself. Otherwise, you can set the XAPPLRESDIR environment variable to the complete path of the directory where you installed the examples. The value of XAPPLRESDIR must end with a / (slash). (Most of the examples will not function properly without the application-defaults files.)

Get XLIB Programming Manual, Rel. 5, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.