Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Graphics Administration Guide: HP 9000 Workstations and Servers > Chapter 3 Compiling Your Application

Compiling HP-PHIGS Applications

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Compiling with Shared Libraries

If you are using shared libraries, as we recommend, linking is device-independent. To compile a C program using shared libraries, you would use the following command:

  • cc example.c -Iphigs-incl -Lcommon/lib -Lphigs-lib \

  • -Iphigs-widget/Motif1.2 -lXwindow -lphigs -ldl \

  • -lhpgfx -ldld -lXhp11 -lXi -lXext -lX11 -lm -o example

FORTRAN users can simply replace cc with fort77 in the above command. Also, if you are a FORTRAN user and prefer using the f77 command, you can replace cc with f77 and change linking options that are specified as follows:

  • -Lpathname

  • to

  • -Wl,-Lpathname

For more information on compiling and linking, read the section "PHIGS PLUS Differences Between HP-PHIGS 2.2/2.3 and 3.0" in the chapter "Functional Overview" in the HP-PHIGS Graphics Techniques manual.

Compiling with Archive Libraries

If you are using archived libraries, you need to include your device's driver library. Note that shared libraries are used by default unless you specify that you want to use archived libraries (by specifying "-Wl,-a,archive").

To compile a C program using archived libraries, you would use the following command:

  • cc example.c -Iphigs-incl -Wl,-a,archive -Lcommon/lib \

  • -Lphigs-lib-Iphigs-widget/Motif1.2 -ldddldevice_drivers \

  • -Wl,-E -Wl,+n -l:libdld.sl -lXwindow -lphigs -ldl \

  • -lhpgfx1 -lhpgfx2 -lXhp11 -lXi -lXext -lX11 -lm \

  • -o example

The "-l:libdld.sl" above specifies the dynamic loader, which is available only in shared-library form.

Multiple graphics device driver libraries may be indicated in the 〈device_drivers〉 location. For example, if your application source file is called app_one.c and the executable is app_one and you are using the CRX graphics device driver (libddgcrx), your compile command would look like this:

  • cc app_one.c -Iphigs-incl-Wl,-a,archive -Lcommon/lib \

  • -Lphigs-lib -Iphigs-widget/Motif1.2 -ldddl -lddgcrx \

  • -Wl,-E -Wl,+n -l:libdld.sl -lXwindow -lphigs -ldl \

  • -lhpgfx1 -lhpgfx2 -lXhp11 -lXi -lXext -lX11 -lm \

  • -o app_one

The "-l:libdld.sl" above specifies the dynamic loader, which is available only in shared-library form.

Fortran users can simply replace cc with fort77 in the above command. Also, if you are a Fortran user and prefer using the f77 command, you can replace cc with f77 and change linking options that are specified as follows:

  • -Lpathname

  • to

  • -Wl,-Lpathname

For more information on compiling and linking, read the section "PHIGS PLUS Differences Between HP-PHIGS 2.2/2.3 and 3.0" in the chapter "Functional Overview" in the HP-PHIGS Graphics Techniques manual.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1996 Hewlett-Packard Development Company, L.P.