How Embedded SQL Programs are Linked--UNIX
Embedded SQL programs require procedures from an Ingres library. The required library is listed below and must be included in your compile or link command after all user modules. You must specify the library in the order shown in the following examples.
Programs Without Embedded Forms
The following example demonstrates the link command of an embedded SQL program called dbentry that was preprocessed and compiled.
cc -o dbentry dbentry.o\
$II_SYSTEM/ingres/lib/libingres.a \
-lm -lc ‑lpthread ‑lcrypt ‑ldl ‑lrt -lstdc++
You must include both the math library and the C runtime library.
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.*
Link Precompiled Forms
The technique of declaring a precompiled form to the FRS is discussed in the Forms‑based Application Development Tools User Guide. To use such a form in your program, you must also follow the steps described here.
To link a precompiled form
1. In VIFRED, Select a menu item to compile a form. VIFRED then creates a file in your directory describing the form in C. Select the name for the file.
2. After creating the C file, compile it into linkable object code with the cc command:
cc -c filename
3. The output of this command is a file with the extension .o. Link this object file with your program by listing it in the link command, as shown in the following example, which includes the compiled form empform.o:
cc -o formentry formentry.o \
empform.o \
$II_SYSTEM/ingres/lib/libingres.a \
-lm –lc
Last modified date: 08/28/2024