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 -I〈phigs-incl〉 -L〈common〉/lib
-L 〈phigs-lib〉 \
-I〈phigs-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:
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 -I〈phigs-incl〉
-Wl,-a,archive -L〈common〉/lib \
-L〈phigs-lib〉
-I〈phigs-widget〉/Motif1.2
-ldddl〈device_drivers〉 \
-Wl,-E -Wl,+n -l:libdld.sl -lXwindow -lphigs -ldl \
-lhpgfx1 -lhpgfx2 -lXhp11 -lXi -lXext -lX11 -lm \
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 -I〈phigs-incl〉
-Wl,-a,archive -L〈common〉/lib \
-L〈phigs-lib〉 -I〈phigs-widget〉
/Motif1.2 -ldddl -lddgcrx \
-Wl,-E -Wl,+n -l:libdld.sl -lXwindow -lphigs -ldl \
-lhpgfx1 -lhpgfx2 -lXhp11 -lXi -lXext -lX11 -lm \
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:
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.