8.3.3 Compiling and linking in Windows

You must use a compiler that conforms to the language used for the UAP in which the SQL statements are embedded to compile and link edit a post-source program created by the preprocessor.

For the compilation and linkage methods in the Windows environment, see the manuals for the compilers applicable to the particular languages. This section explains the compilation and linkage options for each language. The section also contains instructions for Windows (x64).

Organization of this subsection
(1) C
(2) COBOL
(3) Instruction for Windows (x64)

(1) C

To compile post-source programs written in C, use Microsoft Visual C++.

To set options for compilation and linkage using Microsoft Visual C++, from the Project menu, choose Setup. (The setup method differs depending on the Microsoft Visual C++ version.)

Table 8-17 shows the items to be set in Setup.

Table 8-17 Items set with Setup

ItemCategoryCategory settingSetting value
CompilerCode generationAlignment of structure members8 bytes
Runtime library to be usedMulti-thread*
PreprocessorInclude file path\HiRDB\include
LinkerInputLibrary\HiRDB\lib\cltdll
Note
The directory where HiRDB is installed is underlined.

* All libraries except CLTDLL are created with multiple threads.

For Windows Server 2003 (IPF), only the 64-bit mode client library can be used. When creating a UAP in 64-bit mode, adhere to the following conditions:

(2) COBOL

To compile post-source programs in COBOL, use a compiler that conforms to the COBOL85 or COBOL2002 standards. To compile a post-source program in OOCOBOL, use a compiler that conforms to the OOCOBOL standard.

To set options for compilation and linkage using COBOL85 (version 1.0 or subsequent versions), choose Edit, then Edit Project.

For Windows, choose Option, then Compile and Linker.

For COBOL2002, from the Project Setup menu, choose the Linker tab.

Table 8-18 shows the item to be set with Edit Project in COBOL85. Do not specify the -Kl, -Xb, -Bb, or -Fb option. Also do not specify the -Xc option together with -Hf, -Hv, or -V3. Table 8-19 shows the item to be set with Project Setup in COBOL2002.

Table 8-18 Item to be set with Edit Project in COBOL85

ItemSetting itemSetting value
Linkage option settingImport library\HiRDB\lib\cltdll.lib
Compilation option/NOI (Upper-case and lower-case characters are discriminated in the file identifier.)
Note
The directory where HiRDB is installed is underlined.

Table 8-19 Item to be set with Project Setup in COBOL2002

ItemSetting itemSetting value
LinkLibrary specification\HIRDB\lib\cltdll.lib
Note
The directory where HiRDB is installed is underlined.

COBOL85 has an option to be set for Compilation Environment. Table 8-20 shows the item to be set for Compilation Environment in COBOL85. In COBOL2002, this item is set to an environment variable.

Table 8-20 Item to be set for Compilation Environment in COBOL85

ItemSetting itemSetting value
Environment variable setting*CBLLIB variable\HiRDB\include
Note
The directory where HiRDB is installed is underlined.

* For COBOL2002, the item is set for Environment Variable.

(3) Instruction for Windows (x64)

Windows (x64) provides both 32-bit mode and 64-bit mode client libraries. To create a UAP in 32-bit mode, specify the compilation options and library for 32-bit mode. To create a UAP in 64-bit mode, specify the compilation options and library for 64-bit mode.

The following table lists the UAP creation conditions:

Platform32-bit mode
(Win32)
64-bit mode
(x64)
Alignment of structure membersDefault (8 bytes)Default (8 bytes)
Runtime library to be usedMulti-thread DLLMulti-thread DLL
Include file directory\HiRDB\INCLUDE\HiRDB\INCLUDE
Linkage library*\HiRDB\LIB\PDCLTM32.LIB\HiRDB\LIB\PDCLTM64.LIB
Note: Specify an HiRDB installation directory for the area indicated by underscoring.
* Specify regardless of whether the multi-connection facility is to be used.

Note that the following UAPs cannot be created for the 64-bit mode: