DataBlade® client applications
You can compile and link a DataBlade® client application with the libraries.
For information about how to write and compile DataBlade® client applications, see the Informix® DataBlade® API Programmer's Guide.
You must specify the location of the header file, ifxgls.h. This header file is located in %INFORMIXDIR%\incl\public for Windows™ and in $INFORMIXDIR/incl/public for UNIX™.
This directory also contains many of the other files that a DataBlade® client application uses. Therefore, it is an important directory to include when you compile the application.
The following command uses the Microsoft™ compiler,
cl, to compile a DataBlade® client
application called
sample.c
that uses : cl -MD -Id:\msdev\include -Id:\informix\incl\public -Id:\informix\incl\esql \
-Id:\informix\incl -c sample.c
All functions
are exported through the libthdmi.lib library.
For linking, you must specify the following two libraries.
At link time (in lib subdirectory of INFORMIXDIR) | At run time (in bin subdirectory of INFORMIXDIR) | Purpose |
---|---|---|
libthdmi.lib | idmit09a.dll | DataBlade® API functions |
isqlt09a.lib | isqlt09a.dll | ESQL/C functions |
Make sure to include the $INFORMIXDIR/incl/public directory
with the -I compiler option, as follows:
cc -I$INFORMIXDIR/incl/public -I$INFORMIXDIR/esql -I$INFORMIXDIR/incl -c sample.c
The preceding command checks to see whether the API client libraries have been installed in the directory that the INFORMIXDIR environment variable indicates.
On UNIX™ platforms, you must
explicitly specify the location and name of the library, as follows:
- For the library location, use the following -L compiler option:
-L$INFORMIXDIR/lib/esql
- For the library name, include the -lifgls command-line option.
The following command links the sample.o object
file to create an executable file called
sample
:cc -o sample sample.o \
-L$INFORMIXDIR/lib/esql -L$INFORMIXDIR/lib/dmi -L$INFORMIXDIR/lib \
-lifdmi -lifsql -lifasf -lifcss -lifos -lifgen -lifgls -lifglx \
-lnsl -lsocket -laio -lm -ldl -lelf -lw \
$INFORMIXDIR/lib/esql/checkapi.o
Alternatively, you can use the ESQL/C preprocessor, esql,
to compile and link the DataBlade® client
application. The esql preprocessor automatically
links most of the libraries that the client application requires (including
the library).
However, you must explicitly specify the libdmi library.
The following esql command compiles and links the sample.o object
file:
esql -o sample sample.o -L$INFORMIXDIR/lib/dmi -ldmi