Linking thread-safe HCL OneDB general libraries to an ESQL/C module on a UNIX operating system

Perform the following steps to link thread-safe HCL OneDB™ general libraries to the module on a UNIX™ operating system:
  1. Install the DCE thread package on the same client computer as the product. For more information, see your DCE installation instructions.

    If DCE is not available on your platform, ESQL/C can use POSIX thread libraries or Sun Solaris thread libraries.

  2. Set the THREADLIB environment variable to indicate which thread package to use when you compile the application.
    The following C-shell command sets THREADLIB to the DCE thread package:
    setenv THREADLIB DCE

    SOL and POSIX are also valid options for the THREADLIB environment variable.

    Important: This version of supports only the DCE thread package.
  3. Compile your program with the esql command, and specify the -thread command-line option.
    The -thread command-line option tells esql to generate thread-safe code and to link in thread-safe libraries. The following command links thread-safe shared libraries with the file.exe executable file:
    esql -thread file.ec -o file.exe

The -thread command-line option instructs the esql command to perform the following steps:
  1. Pass the -thread option to the preprocessor to generate thread-safe code.
  2. Call the C compiler with the -DIFX_THREAD command-line option.
  3. Link the appropriate thread libraries (shared or static) to the executable file.
Tip: You must set the THREADLIB environment variable before you use the esql command with the -thread command-line option.
If you specify the -thread option but do not set THREADLIB, or if you set THREADLIB to some unsupported thread package, the esql command issues the following message:
esql: When using -thread, the THREADLIB environment variable
   must be set to a supported thread library. Currently
   supporting: DCE, POSIX(Solaris 2.5 and higher only) and
   SOL (Solaris Kernel Threads)