Linking shared HCL OneDB general libraries to an ESQL/C module

About this task

To link shared HCL OneDB™ general libraries to an ESQL/C module:

Procedure

  1. Set the environment variable that specifies the library search path at run time so that it includes the $INFORMIXDIR/lib and $INFORMIXDIR/lib/esql paths on a UNIX™ operating system; and %INFORMIXDIR%lib in a Windows™ environment.
    On many UNIX operating systems, the LD_LIBRARY_PATH environment variable specifies the library search path. The following command sets LD_LIBRARY_PATH in a C shell:
    setenv LD_LIBRARY_PATH $INFORMIXDIR/lib:$INFORMIXDIR/ 
    lib/esql:/usr/lib 
    In Windows environments, use the following command:
    set LIB = %INFORMIXDIR%\lib\;%LIB%
  2. Compile your program with the esql command.
    To link shared HCL OneDB general libraries with the module, you do not need to specify a command-line option. links shared libraries by default. The following command compiles the file.ec source file with shared HCL OneDB libraries:
    esql file.ec -o file.exe

Results

The esql command also uses the symbolic name when it links the thread-safe shared HCL OneDB general libraries with the application.