Compiling and Linking Embedded SQL Applications

The sqlprep precompiler creates a C program with the file extension .C from your Embedded SQL programs. For example, from the Embedded SQL program MYPROGRM.SQC, sqlprep creates a C program named MYPROGRM.C. You can compile the C program for a specific operating system or platform by using the appropriate C compiler.

The Embedded SQL for C precompiler does not support preprocessing of C++ modules. To use Embedded SQL in a C++ application, you must create separate C-language modules for your data access functions and preprocess only those modules. ESQL/C also does not support the use of precompiled headers, since the first step in preprocessing is to expand all include files. You can improve compilation time by segregating data access code into .SQC modules that have a minimum number of #include files.

If your program contains an #include windows.h statement, you must precede it with the following two statements:


#define _OLE2_H_
#define NOIME

In this example, the OLE2.H and IMM.H header files are excluded. The OLE2.H and IMM.H header files are not compatible with version 6.5 of Embedded SQL.

The Transact-SQL keyword null should not be in uppercase in Embedded SQL programs to avoid conflict with the C keyword NULL. Also, the Embedded SQL keyword delete and the Transact-SQL keyword in should not be in uppercase in applications for 32-bit Windows to avoid conflict with 32-bit Windows–defined constants in WINDOWS.H.

For more information about how to compile and link precompiled Embedded SQL programs for each of the available platforms, see the following sections:

"Compiling and Linking for Windows NT and Windows 95"

"Compiling and Linking for 16-bit Windows"

"Compiling and Linking for MS-DOS"

"Compiling and Linking for QuickWin"