IBM Books

What's New


Changes to Chapter 7. Building DB2 Call Level Interface (CLI) Applications

On page 128, replace the first part of the section "Windows NT and Windows 95" with the following:

Windows NT, Windows 98 and Windows 95
Note:All applications on Windows NT, Windows 98 and Windows 95, both embedded SQL and non-embedded SQL, must be built in a DB2 command window, and not from an operating system command prompt.

Microsoft Visual C++ is used in the following batch file, clibld.bat.

rem  clibld batch file - Windows NT, Windows 98 and Windows 95 - Microsoft Visual C++
rem  Build a CLI sample C program.
rem  Compile the program.  
cl -Z7 -Od -c -W1 -D_X86=1 -DWIN32 -I:%DB2PATH%\include clisampl.c
rem Compile common utility functions used by most CLI sample programs.
cl -Z7 -Od -c -W1 -D_X86=1 -DWIN32 -I:%DB2PATH%\include samputil.c
rem  Link the program.
link -debug:full -debugtype:cv -OUT:clisampl.exe clisampl.obj samputil.obj db2cli.lib


Compile and Link Options for clibld

The batch file contains the following compile options:

cl
The Microsoft Visual C++ compiler.

-Z7
C7 style CodeView information generated.

-Od
Disable optimizations. It is easier to use a debugger with optimization off.

-c
Perform compile only; no link. This book assumes that compile and link are separate steps.

-W1
Set warning level.

The batch file contains the following link options:

link
Use the 32-bit linker to link edit.

-debug:full
Include debugging information.

-debugtype:cv
Indicate the debugger type.

-OUT:clisampl.exe
Specify the executable.

clisampl.obj
Include the object file.

samputil.obj
Include the utility object file for error checking.

db2cli.lib
Link with the DB2 CLI library.

Refer to your compiler documentation for additional compiler options.

On page 131, replace the first part of the section "OS/2" with the following:

OS/2

IBM VisualAge C++ is used in the following command file, clibld.cmd.

rem clibld command file - OS/2 - IBM VisualAge C++ compiler
rem Build a CLI sample C program.
rem Compile the program.
icc -C+ -O- -Ti+ clisampl.c
rem Compile common utility functions used by most CLI sample programs.
icc -C+ -O- -Ti+ samputil.c
rem Link the program.
ilink /NOFREE /NOI /DEBUG /ST:32000 /PM:VIO clisampl.obj
    samputil.obj,clisampl.exe,NUL,db2cli.lib;

Compile and Link Options for clibld

The command file contains the following compile options:

icc
The IBM VisualAge C++ compiler.
-C+
Perform compile only; no link. This book assumes that compile and link are separate steps.
-O-
No optimization. It is easier to use a debugger with optimization off.
-Ti+
Generate debugger information

The command file contains the following link options:

ilink
Use the ilink linker to link edit.
/NOFREE
No free format.
/NOI
No Ignore Case. Force case sensitive identifiers.
/DEBUG
Include debugging information.
/ST:32000
Specify a stack size of at least 32 000.
/PM:VIO
Enable the program to run in an OS/2 window.
clisampl.obj
Include the object file.
samputil.obj
Include the utility object file for error checking.
clisampl.exe
Specify the executable.
NUL
Specify a NUL option.
db2cli.lib
Link with the DB2 CLI library.

Refer to your compiler documentation for additional compiler options.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]