This document intends to provide clear and concise information on compiling with the IBM Communications Server V5 for AIX (5765-D20) and IBM Communications Server V6 for AIX (5765-E51).
This document applies to Communications Server Versions 5 & 6 for AIX, which run on AIX Version 4.
Information on designing, writing, and compiling programs using the
CS/AIX V5 and V6 libraries can be found in the appropriate manuals for the API
that you are using. These manuals are available online at http://www.ibm.com/software/network/commserver/library/publications
The following hardcopy manuals are also available:
NOTE: The preceding manuals contain a few compiling instruction errors. The information in this document attempts to clear up those errors.The product documentation library is also available:
Programs designed for and written using the Communications Server Version 4 libraries can be successfully compiled following the instructions in the manual Communications Server for AIX Transaction Program Reference, Version 4 Release 2 (SC31-8212-02). These libraries are provided primarily for backlevel compatibility of existing programs. New programs should be written using the CS/AIX V5 and V6 libraries.
The CS/AIX libraries are located in the /usr/lib/sna/ directory and are provided in two formats. The first format is libxxx.o, which is a shared library. The second format is xxx.exp, which is an export file referencing the libxxx.o library (the string xxx is a placeholder and does not reference an actual library name).
The method described in the manuals that links these libraries (-l xxx), works for libraries with names in the format libxxx.a, but it does not work with the libraries as provided. Four possible solutions to this problem follow:
We recommend Option 1, which we consider the best option. Option 2 is also a good solution, except the symbolic links will have to be created on every system on which the program runs. Options 3 and 4 will work, but the libraries will be statically linked. If any updates are made to the libraries, the program will have to be relinked to pick up the updated libraries. Failure to pick up the updated libraries will miss any fixes and the program may potentially run into incompatibilities.
For each library, two different versions are provided. One version is for mono-threaded applications and the names are in the format libxxx.o and xxx.exp. The other version is for multi-threaded applications and the names are in the format libxxx_r.o and xxx_r.exp.
Which libraries are needed depends on the API verbs that are used. The xxx.exp files list the entry-point functions for the libraries. The CPI-C API has a separate entry-point for each verb. The other APIs have one or two entry-point functions. The different verbs are different structures passed to these entry points. To determine which library to use, look in the xxx.exp files for the library function being called. The export file that contains the function indicates which library is needed. In addition, any CPI-C verb, which requires the cpic library, also requires the appc library.
An example line that compiles the csample1.c sample program, found in the /usr/lib/sna/samples/ directory, follows:
cc -o csample1 -I /usr/include/sna -bimport:/usr/lib/sna/cpic.exp \ -bimport:/usr/lib/sna/appc.exp -bimport:/usr/lib/sna/nof.exp \ /usr/lib/sna/samples/csample1.c
[ Doc Ref: 93751279712030 Publish Date: Nov. 07, 2000 4FAX Ref: 6542 ]