The compile and link options in this topic are recommended
by DB2® for building CLI applications
with the HP-UX C compiler. They are demonstrated in the sqllib/samples/cli/bldapp build script.
Compile options:
- cc
- Use the C compiler.
- $EXTRA_CFLAG
- If the HP-UX platform is IA64 and 64-bit support
is enabled, this flag contains the value +DD64; if 32-bit support is enabled, it contains the value +DD32.
- +DD64
- Must be used to generate 64-bit code for HP-UX on IA64.
- +DD32
- Must be used to generate 32-bit code for HP-UX on IA64.
- -Ae
- Enables HP ANSI extended mode.
- -I$DB2PATH/include
- Specify the location of the DB2 include files. For example: $HOME/sqllib/include
- -mt
- Enable multi-thread support. This option is required when you
are compiling C/C++ applications.
- -c
- Perform compile only; no link. Compile and link are separate steps.
Link options:
- cc
- Use the compiler as a front end for the linker.
- $EXTRA_CFLAG
- If the HP-UX platform is IA64 and 64-bit support
is enabled, this flag contains the value +DD64; if 32-bit support is enabled, it contains the value +DD32.
- +DD64
- Must be used to generate 64-bit code for HP-UX on IA64.
- +DD32
- Must be used to generate 32-bit code for HP-UX on IA64.
- -o $1
- Specify the executable program.
- $1.o
- Specify the object file.
- utilcli.o
- Include the utility object file for error checking.
- $EXTRA_LFLAG
- Specify the runtime path. If set, for 32-bit it contains the value -Wl,+b$HOME/sqllib/lib32, and for 64-bit: -Wl,+b$HOME/sqllib/lib64. If not set, it contains no value.
- -L$DB2PATH/$LIB
- Specify the location of the DB2 runtime shared libraries. For 32-bit: $HOME/sqllib/lib32; for 64-bit: $HOME/sqllib/lib64.
- -ldb2
- Link with the database manager library.
- -mt
- Enable multi-thread support. This option is required when you
are linking to C/C++ applications.
- -lunwind
- Link with the HP-UX unwind library to support DB2 problem determination features. This option
is required.
Refer to your compiler documentation for additional
compiler options.