HP Visualize J5000 hp workstations - hp-ux 10.20 graphics administration guide - Page 16

Compiling with Archive Libraries

Page 16 highlights

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: cc example.c -I -Wl,-a,archive -L/lib \ -L -I/Motif1.2_R6 -ldddl \ -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 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 -Wl,-a,archive -L/lib \ -L -I/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 to -Wl,-L 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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171

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:
cc example.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:
cc app_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.
Graphics Administration Guide for HP-UX 10.20
Page 16