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:
- The IBM C compiler.
- Contains the value "-q64" for 64-bit environments; otherwise, contains no value.
- Specify the location of the Db2 include files. For example: $HOME/sqllib/include
- Perform compile only; no link. This script has separate compile and link steps.
xlc
$EXTRA_CFLAG
-I$DB2PATH/include
-c
- Link options:
- Use the compiler as a front end for the linker.
- Contains the value "-q64" for 64-bit environments; otherwise, contains no value.
- Specify the executable program.
- Specify the object file.
- Include the utility object file for error checking.
- 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. - Link with the DB2CI library.
xlc
$EXTRA_CFLAG
-o $1
$1.o
utilci.o
-L$DB2PATH/$LIB
-ldb2ci