Use the C compiler to compile a C UDR. Include the following compiler options:
These paths include the following subdirectories of the main Informix installation directory (which the INFORMIXDIR environment variable specifies):
MI_SERVBUILD
On UNIX or Linux, the following sample command compiles the C UDR in the abs.c source file:
/compilers/bin/cc -I $INFORMIXDIR/incl -I $INFORMIXDIR/incl/esql -c abs.c cc -KPIC -DMI_SERVBUILD -I$INFORMIXDIR/incl/public \ -I$INFORMIXDIR/incl -L$INFORMIXDIR/esql/lib -c abs.c
At runtime:
LB_LIBRARY_PATH=/opt/informix/lib:/opt/informix/lib/esql
The following command is a sample of how to compile a C UDR named abs.c for Windows:
cl /DNT_MI_SAPI /DMI_SERVBUILD -Id:\msdev\include -Id:\informix\incl\public -Id:\informix\incl -c abs.c