Compiling with Archive Libraries

If you are using archived libraries, you need to include your device's driver library.

___________________________________________________________________________________

Note: 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:

ccexample.c –I<phigs-incl> -Wl,-a,archive –L<common>/lib \ -L<phigs-lib> -I<phigs- widget>/Motif1.2_R6 –ldddl<device_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:

ccapp_one.c –I<phigs-incl> -Wl,-a,archive –L<common>/lib \ -L<phigs-lib> -I<phigs- widget>/Motif1.2_R6 -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:

-L<pathname> to -Wl,-L<pathname>

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.

Page 16

Graphics Administration Guide for HP-UX 10.20