The script file clibld contains the commands to build the sample DB2 CLI program clisampl.c. You can find both the script file and clisampl.c in sqllib/samples/cli.
Study the script file and the compiler options for the platform you are using. Then go to "Building and Running a CLI Program" for the steps to follow in order to build and run the program.
IBM XL C is used in the following version of the clibld script file:
#! /bin/ksh # clibld script file -- AIX # Build clisampl # Compile the program. xlc -I/usr/lpp/db2_05_00/include -c clisampl.c # Link the program. xlc -o clisampl clisampl.o -L/usr/lpp/db2_05_00/lib -ldb2 |
Compile and Link Options for clibld |
---|
The script file contains the following compile options:
|
The script file contains the following link options:
Refer to your compiler documentation for additional compiler options.
|
Note: | Multi-threaded applications on AIX Version 4 need to be compiled and linked with the xlc_r compiler instead of the xlc compiler, or with the xlC_r compiler instead of the xlC compiler. |
HP-UX C is used in the following version of the clibld script file:
#! /bin/ksh # clibld script file -- HP-UX # Build clisampl # Compile the program. cc -Aa +e -I/opt/IBMdb2/v5.0/include -c clisampl.c # Link the program. cc -o clisampl clisampl.o -L/opt/IBMdb2/v5.0/lib -ldb2 -lhppa |
Compile and Link Options for clibld |
---|
The script file contains the following compile options:
|
The script file contains the following link options:
Refer to your compiler documentation for additional compiler options.
|
Note: | Multi-threaded applications on HP-UX need to be linked with libcma.sl. Add -lcma to the end of the link command when building a multi-threaded application. |
SPARCompiler C is used in the following version of the clibld script file:
#! /bin/ksh # clibld script file -- Solaris # Build clisampl # Compile the program. cc -I/opt/IBMdb2/v5.0/include -c clisampl.c # Link the program. cc -o clisampl clisampl.o -L/opt/IBMdb2/v5.0/lib -R/opt/IBMdb2/v5.0/lib -ldb2 |
Compile and Link Options for clibld |
---|
The script file contains the following compile options:
|
The script file contains the following link options:
Refer to your compiler documentation for additional compiler options.
|
Note: | Multi-threaded applications on Solaris need to be compiled with the -D_REENTRANT flag, and linked with libthread.so. Add -D_REENTRANT following the cc or xlc compile command, and add -lthread to the end of the link command, when building a multi-threaded application. |