DB2CI application compile and link options (AIX)

The compile and link options in this topic are recommended for building DB2CI applications with the AIX® IBM® C compiler.

You can find the following options in the DB2DIR/samples/cli/bldapp batch file, where DB2DIR is the location where your Db2® copy is installed.

Compile options:
xlc
The IBM C compiler.
$EXTRA_CFLAG
Contains the value "-q64" for 64-bit environments; otherwise, contains no value.
-I$DB2PATH/include
Specify the location of the Db2 include files. For example: $HOME/sqllib/include
-c
Perform compile only; no link. This script has separate compile and link steps.
xlc
Use the compiler as a front end for the linker.
$EXTRA_CFLAG
Contains the value "-q64" for 64-bit environments; otherwise, contains no value.
-o $1
Specify the executable program.
$1.o
Specify the object file.
utilci.o
Include the utility object file for error checking.
-L$DB2PATH/$LIB
Specify the location of the Db2 runtime shared libraries. For example: $HOME/sqllib/$LIB. If you do not specify the -L option, the compiler assumes the following path: /usr/lib:/lib.
-ldb2ci
Link with the DB2CI library.