2. Embedded SQL for C : Preprocessor Operation : Command Line Operations : The C Compiler
 
Share this page                  
The C Compiler
The preprocessor generates C code. You can then use the following platform-specific commands to compile this code.
Windows:
You can use the Windows cl command to compile this code. All compiler options can be used.
The following example preprocesses and compiles the file test1:
esqlc test1.sc
cl -c test1.c
UNIX:
The following example shell script preprocesses, compiles, and links the file test1.sc:
#!/bin/sh
 
. $II_SYSTEM/ingres/utility/iisysdep
 
program_name=test1
 
esqlc $program_name.sc
if [ $? != 0 ]
then
    exit
fi
 
$CC ‑I . $CCPICFLAG $CCMACH $CCFLAGS ‑c $program_name.c # $OPTIM
if [ $? != 0 ]
then
    exit
fi
 
$CC ‑o $program_name $program_name.o $* $CCMACH $II_SYSTEM/ingres/lib/libingres.a $LDLIBMACH
VMS:
You can use the VMS cc command to compile the code. Most of the cc command line options can be used. You should not use the g_float qualifier (to the VAX C compiler) if floating-point values in the file are interacting with Ingres floating-point objects.
As of Ingres II 2.0/0011 (axm.vms/00) Ingres uses member alignment and IEEE floating-point formats. Embedded programs must be compiled with member alignment turned on. In addition, embedded programs accessing floating-point data (including the MONEY data type) must be compiled to recognize IEEE floating-point formats.
The VMS default qualifier /g_float is not a standard and should not be used.
On Alpha systems, hardware support for D_float is only partial, the default has changed to G_float, and support for IEEE (IEEE 754-1985 standard for floating point arithmetic) has been added. Because of this, and because IEEE is available on other platforms and is recognized as an industry standard, Ingres for OpenVMS Alpha uses the IEEE format.
All programs and libraries should be compiled using the IEEE qualifier. Do not mix programs or libraries compiled with different qualifiers.
For example:
esqlc prog.sc
cc /float=ieee prog
Failure to use the /float=ieee qualifier or the use of non-IEEE float numbers will result in unpredictable results when non-IEEE floats are used as keys or in restrictions.
The following example preprocesses and compiles the file test1. Note that both the embedded SQL preprocessor and the C compiler assume the default extensions.
esqlc test1
cc/list test1
Note:  For operating system specific information on compiling and linking ESQL/C programs, see the Readme file.