Compatibility of Pre-existing ESQL/C Applications with Current Library Versions
You specify the esql command-line options in Figure 13-2 to tell the esql command which version of the Informix libraries to link with the ESQL/C application. Once the esql command successfully compiles and links your application, the version of the Informix general libraries is fixed. When you install a new version of ESQL/C, you receive new copies of the Informix general libraries. Whether you need to recompile and relink your existing ESQL/C applications to run with these new copies depends on the factors that the following table describes.
On UNIX, you can use the ifx_getversion utility to determine the version of an Informix library that is installed on your system. For more information, see "Using the ifx_getversion Utility". 
In Windows environments, use the following find command to find the occurrence of the string that contains the version number in the isqlt09A.dll. Note that the command needs to be issued from the %INFORMIXDIR%\bin directory.
The output of the find command is shown below:

Using the ifx_getversion Utility
To obtain the complete version name of an Informix library, use the ifx_getversion utility. Before you run ifx_getversion, set the INFORMIXDIR environment variable to the directory in which your Informix product is installed.
The ifx_getversion utility has the following syntax.
The following example shows sample output that the ifx_getversion utility generates for the libgen Informix library:
Output of ifx_getversion depends on the version of ESQL/C software that is installed on your system. 
Checking the API Version of a Library
When you invoke an ESQL/C application that is linked with shared Informix general libraries, the release number of these shared libraries must be compatible with that of the shared libraries in the $INFORMIXDIR/lib or the %INFORMIXDIR%\lib directory.
In a Windows environment, a developer can easily verify the name of the shared library DLL, namely isqltnnx.dll, where nn stand for the version number, and x stand for the API version. 
In case of an ESQL/C application on UNIX, however, given that the linked libraries get symbolic names, it is not easy to find the version number of the linked library. Therefore, ESQL/C does this check for you. ESQL/C performs an internal check between the API version of the library that the application uses and the API version of the library that is installed as part of your ESQL/C product. Figure 13-3 shows where the API version appears in the shared library name.
ESQL/C uses an Informix function that is called checkapi() to perform this check. The checkapi() function is in the checkapi.o object file, which is contained in the $INFORMIXDIR/lib/esql directory. The esql command automatically links this checkapi.o object file with every executable that it creates.
To determine the API version of the library that the application uses, ESQL/C checks the values of special macro definitions in the executable file. When the ESQL/C preprocessor processes a source file, it copies the macro definitions from the sqlhdr.h header file into the C source file (.c) that it generates. The following example shows sample values for these macros:
If the API version of the libraries in this executable file are not compatible, ESQL/C returns a runtime error that indicates which library is not compatible. You must recompile your ESQL/C application to link the new release-version of the shared library.
If you do not use esql to link one of the shared Informix general libraries with your ESQL/C application, you must explicitly link the checkapi.o file with your application. Otherwise, ESQL/C might generate an error at link time of the form:

|