4. Embedded SQL for Fortran : Preprocessor Operation : How Embedded SQL Programs are Linked
 
Share this page                  
How Embedded SQL Programs are Linked
Embedded SQL programs require procedures from an Ingres library or libraries depending on your operating system as described below.
UNIX:
The Ingres library "libingres.a" must be included in your compile (f77) or link (ld) command after all user modules. The following example demonstrates how to compile and link an Embedded SQL program called "dbentry" that has passed through the preprocessor:
f77 -o dbentry dbentry.f \
     $II_SYSTEM/ingres/lib/libingres.a\
     -lm\
     -lc
Note that you must include the math library (the "m" argument to the -l flag).
Ingres shared libraries are available on some UNIX platforms. To link with these shared libraries replace "libingres.a" in your link command with:
-L $II_SYSTEM/ingres/lib -linterp.1 -lframe.1 -lq.1 \
     -lcompat.1
To verify if your release supports shared libraries check for the existence of any of these four shared libraries in the $II_SYSTEM/ingres/lib directory. For example:
ls -l $II_SYSTEM/ingres/lib/libq.1.*  
VMS:
Embedded SQL programs require procedures from several VMS shared libraries. When you have preprocessed and compiled an Embedded SQL program, you can link it. Assuming the object file for your program is called "dbentry," use the following link command:
link dbentry.obj,-
 ii_system:[ingres.files]esql.opt/opt  
Windows:
The Ingres library libingres.lib must be included in your compile (df) or link (link) command after all user modules. The following example demonstrates how to compile and link an Embedded SQL program called "dbentry" that has passed through the preprocessor:
df /name:as_is /iface:nomixed_str_len_arg /iface:cref dbentry.for \
     %II_SYSTEM%\ingres\lib\libingres.lib \
     /link /nodefaultlib