Compile with the -thread and -l preprocessor options

You must compile the application by using the -thread and the -l preprocessor options.

The -thread option indicates that you are linking thread-safe libraries instead of the default HCL Informix® shared libraries. The -l option allows you to specify system libraries that you want to link. Finally, you compile your application, link libdynthr.so and run it, as shown in the following example:
% setenv THREADLIB "dynamic"
% esql -thread -ldynthr test.ec -o test.exe
% test.exe