| United States-English |
|
|
|
![]() |
HP PEX Implementation and Programming Supplement: HP9000 Series 700 Color Workstations > Chapter 4 Utilities, Compiling And Linking,
Examples and Demos Introduction |
|
The PEXlib Programming Manual, Chapter 3, "Getting Started", and the on-line version of Chapter 3, HP PEX On-Line Information System, both illustrate the general steps for creating and running PEXlib programs. Specifics are included in the on-line documentation, where source code is compiled; see the make files for details. Instructions in this chapter are supplemental and necessary in order to develop and run programs on Hewlett-Packard workstations. Listing the contents of the 〈pex〉 directory\Footnote The actual pathname of this directory depends on the file system structure. See the Graphics Administration Guide for details.\EndFootnote{}, you will see a number of important subdirectories, including: Table 4-1 Demos, Utilities, and Program Examples
HP PEX uses standard C and X11 header files, providing definitions and declarations shared among program files (list the 〈pex_incl〉 directory\Footnote The actual pathname of this directory depends on the file system structure. See the Graphics Administration Guide for details.\EndFootnote{}). Most, if not all programs, will require that at least these header files must be included at the beginning of your programs. Your program may require others in addition to these.
Most HP PEXlib programs and applications that only use the standard PEXlib data types, definitions, and function declarations, need only include the header file PEXlib.h under the 〈include〉 directory. Use the following syntax:
Notice that PEXlib.h includes several key Xlib header files such as Xlib.h. It also includes PEX.h, which is a separate file in the same directory, and contains the definitions and types defined by the PEX protocol. Still other header files may be needed by your program, depending on your application. For example, in order to provide access to the additional functionality of multi-buffering extension and the CGE extensions (among varied workstation platforms from workstation vendors, including Hewlett-Packard) you must include PEXExtlib.h, as shown below. Among these header files are PEXExtlib.h and PEXHPlib.h, which must be included in your program after PEXlib.h, as the final include example shows.
For 5.1v3 and later HP PEX releases, a new header file, PEXHPlibint.h is included by PEXlib.h. Another example is the colormap and visual utilities that require you to include PEXUtCmap.h from the 〈cge_utils〉\Footnote The actual pathname of this directory depends on the file system structure. See the Graphics Administration Guide for details.\EndFootnote{} directory. This header file defines the constants and structure types for use with these utilities. Instructions for including various additional header files are usually provided with the README file that accompanies the utility or function. The README also includes instructions for using or operating the utilities. Table 4-2 Header Files for Advanced Functionality
Now your header file declarations at the beginning of your program should appear:
A number of utilities have been added to the HP PEXlib product that simplify and speed programming or which enable you to display sophisticated images. To encourage and assist you in the development of applications based on the common graphics interoperability conventions, a number of highly recommended utilities are made available in the directory 〈cge-utils〉\Footnote The actual pathname of this directory depends on the file system structure. See the Graphics Administration Guide for details.\EndFootnote{}:
A shared library providing these utilities is shipped as 〈pex-lib〉4/libPEXUt.sl. The directory 〈ora_examples〉, which contains the examples from PEXlib Programming Manual, also contains the book_utils.c utility. O'Reilly developed this utility to set up the workstation. However, it is important to notice that HP has modified book_utils.c shipped with the HP PEX product to provide improved interoperability and properly set up HP workstations to run the O'Reilly programs. Hewlett-Packard recommends that you use the HP-modified utility instead, especially if you intend to use programs from other workstations which use O'Reilly examples, or if you obtain the programs again directly from O'Reilly &Associates per the instructions in the Preface of PEXlib Programming Manual, "Obtaining the Example Programs."
Hewlett-Packard ships a number of additional utilities with the HP PEX product. These utilities are in the 〈pex_utils〉 directory\Footnote The actual pathname of this directory depends on the file system structure. See the Graphics Administration Guide for details.\EndFootnote{}. See the README file in this directory to learn about these utilities and how they are useful. Table 4-3 HP Utilities in Utilities Directory
The HP PEX product contains many examples and programs, in addition to those supplied with the O'Reilly PEXlib Programming Manual, that demonstrate use of various functions and utilities that can make you more productive or to display more sophisticated images. The 〈pex〉 directory contains the examples and demos. This directory and subdirectories for each of the examples and programs also contains a README file to explain the contents and, importantly, instructions for using the programs. This table notes some of these examples; see the directories themselves for a complete list, and the README files in the directories for explanations.
The file\Footnote The actual pathname of this directory depends on the file system structure. See the Graphics Administration Guide for details.\EndFootnote{} 〈hp-examples〉/README describes how Makefile is used to build executable programs of the various examples included in the directory. HP PEXlib is supported on the Series 700 workstations using shared libraries that must be linked with the application program. When you compile your PEXlib programs, you must link the application with the PEXlib library libPEX5 just as described in the PEXlib Programming Manual and on-line system. Notice that the PEX library is dependent on the math library. A compile line will typically appear:
See the Graphics Administration Guide for more information on compiling. This table summarizes the shared libraries and X11 directories that are linked on the command line example above. Table 4-4 Shared Libraries and X11 Directories
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||