McAfee MEJCAE-AM-DA Product Guide - Page 86

Programming with the E-Business Server API, Programming on Win32, Setting the run-time library path

Page 86 highlights

Using the E-Business Server API Programming with the E-Business Server API Programming with the E-Business Server API The E-Business Server API is supported on Win32 and several UNIX platforms. The following sections provide information for using the API on these platforms. Programming on Win32 The E-Business Server API functions are exported from the main E-Business Server DLL, EBSEngine.dll. This file is installed in the top-level E-Business Server installation directory. The other EBSsdk DLLs are installed to \%SYSTEMROOT%\system32. The three API header files-PGPBase.h, PGPeBiz.h and PGPPFLConfig.h-are installed in a .\include directory under the E-Business Server installation directory. A .\lib directory containing the import library file EBSEngine.lib is installed at the same level as the .\include directory. Win32 applications using the API must include PGPeBiz.h and link to EBSEngine.lib. The only header file you need to include in your source is PGPeBiz.h, which in turn loads the other E-Business Server header files. Ensure that the location of the supplied header files is included in your compiler's include path. Programming on UNIX On UNIX platforms, the three API header files are installed in the directory /usr/local/ebs/include. This directory needs to be included in the header search path. The only header file you need to include in your source is PGPeBiz.h, which in turn loads the other E-Business Server header files. The shared object libraries are installed in the /usr/local/ebs/lib directory. Sample Linux gcc command lines with appropriate switches and paths are shown below: Compilation example: gcc -I/usr/local/ebs/include -c userprog.c -o userprog.o Linking example: gcc userprog.o -o userprog -L/usr/local/ebs/lib \ -lEBSEngine -lEBSsdk -lEBSsdkNetwork -1m Setting the run-time library path The way that the run-time library path is set varies between the various UNIX platforms. The only platform on which no manual configuration need be performed is Linux. The following sections discuss the steps required to ensure your programs can find the EBSsdk shared libraries at run time. Note: You may need to consult your compiler and linker user manuals for more information on using shared libraries and the run-time linker. Linux The way Linux locates run-time libraries differs from other versions of UNIX. For Linux, the E-Business Server installation script adds the /usr/local/ebs/lib path to /etc/ld.so.conf and runs ldconfig -v to update /etc/ld.so.cache. This means that no special steps are required to ensure that applications can find the EBSsdk libraries, so long as the libraries, or links to the libraries, exist in their default installation path. Solaris For Solaris, you can set your RPATH properly in your executable. For example, you might specify a "-R/usr/local/ebs/lib" option to the Solaris Linker. Alternatively, you can add /usr/local/ebs/lib to the LD_LIBRARY_PATH environment variable or put links to the EBSsdk libraries in the default run-time library directory, /usr/lib. AIX and HP-UX By default, the AIX and HP-UX linkers will imbed any -L paths into the executable, and the run-time linker will use these paths to locate required shared libraries. E-Business Server™ 8.6 Product Guide 84

  • 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
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188

E-Business Server
8.6
Product Guide
84
Using the E-Business Server API
Programming with the E-Business Server API
Programming with the E-Business Server API
The E-Business Server API is supported on Win32 and several UNIX platforms. The following sections
provide information for using the API on these platforms.
Programming on Win32
The E-Business Server API functions are exported from the main E-Business Server DLL,
EBSEngine.dll
. This
file is installed in the top-level E-Business Server installation directory. The other EBSsdk DLLs are installed
to
\%SYSTEMROOT%\system32
.
The three API header files—
PGPBase.h
,
PGPeBiz.h
and
PGPPFLConfig.h
—are installed in a
.\include
directory
under the E-Business Server installation directory. A
.\lib
directory containing the import library file
EBSEngine.lib
is installed at the same level as the
.\include
directory. Win32 applications using the API must
include
PGPeBiz.h
and link to
EBSEngine.lib
.
The only header file you need to include in your source is
PGPeBiz.h
, which in turn loads the other E-Business
Server header files. Ensure that the location of the supplied header files is included in your compiler’s include
path.
Programming on UNIX
On UNIX platforms, the three API header files are installed in the directory
/usr/local/ebs/include
. This
directory needs to be included in the header search path. The only header file you need to include in your
source is
PGPeBiz.h
, which in turn loads the other E-Business Server header files.
The shared object libraries are installed in the
/usr/local/ebs/lib
directory. Sample Linux
gcc
command
lines with appropriate switches and paths are shown below:
Compilation example:
gcc -I/usr/local/ebs/include -c userprog.c -o userprog.o
Linking example:
gcc userprog.o -o userprog -L/usr/local/ebs/lib \ -lEBSEngine -lEBSsdk -lEBSsdkNetwork -1m
Setting the run-time library path
The way that the run-time library path is set varies between the various UNIX platforms. The only platform
on which no manual configuration need be performed is Linux. The following sections discuss the steps
required to ensure your programs can find the EBSsdk shared libraries at run time.
Note:
You may need to consult your compiler and linker user manuals for more information on using shared libraries and
the run-time linker.
Linux
The way Linux locates run-time libraries differs from other versions of UNIX. For Linux, the E-Business
Server installation script adds the
/usr/local/ebs/lib
path to
/etc/ld.so.conf
and runs
ldconfig -v
to
update
/etc/ld.so.cache
. This means that no special steps are required to ensure that applications can find
the EBSsdk libraries, so long as the libraries, or links to the libraries, exist in their default installation path.
Solaris
For Solaris, you can set your
RPATH
properly in your executable. For example, you might specify a
-R/usr/local/ebs/lib
” option to the Solaris Linker. Alternatively, you can add
/usr/local/ebs/lib
to the
LD_LIBRARY_PATH environment variable or put links to the EBSsdk libraries in the default run-time library
directory,
/usr/lib
.
AIX and HP-UX
By default, the AIX and HP-UX linkers will imbed any
-L
paths into the executable, and the run-time linker
will use these paths to locate required shared libraries.