Which version of ODBC-ODBC Bridge should I use?

Linux systems can run with two different and incompatible C runtime libraries. libc5 is the old C runtime library and glibc (also known as libc6) is the latest thread-safe version. The Easysoft ODBC-ODBC Bridge version for libc5 doesn't work with a glibc-based system and vice versa. It's not always straightforward deciding whether your system is libc5-based or glibc-based. Many Linux distributions use glibc by default, but also include the older libc library to maintain backwards compatibility. If you don't know which runtime library you have, try:

ls /lib/libc.*

On our glibc-based machine, that command produces:

/lib/libc.so.4
/lib/libc.so.5
/lib/libc.so.6
/lib/libc.so.4.7.6
/lib/libc.so.5.4.46

The output contains libc.so.6, which indicates this machine is running glibc. If libc.so.6 is not in the output, it's likely you have a libc5-based system.

The ODBC-ODBC Bridge distribution contains a program called testlib, which uses C runtime functions and maths library functions. The installation runs testlib to make sure you have the required libraries, and if you don't, the installation stops.

There are further issues however. Even if you have libc5 and glibc support, what version of the C runtime library does your compiler and linker use when you create new libraries and executables? This is a key issue. If you have both libc5 and glibc, but gcc or ld create executables linked with glibc, you can't use the libc version of ODBC-ODBC Bridge with other programs that you build yourself. (For example, Perl or PHP.)

The testlib program code is:

#include <stdio.h>
#include <math.h>

int main()
{
   double      j = 3.14;

   printf("hello%1.0f\n", ceil(j));
   return 0;
}

To find out which version of ODBC-ODBC Bridge you need:

  1. Create a file named testlib.c containing the code shown earlier.
  2. Compile testlib:
    cc -o testlib testlib.c -lm
  3. Run ldd on testlib:
    ldd ./testlib
  4. Examine the output to find out what versions of the C runtime library and maths library your system is using. For example:
    $ cc -o testlib testlib.c -lm
    $ ldd ./testlib
    libm.so.5 => /lib/libm.so.5 (0x4000b000)
    libc.so.5 => /lib/libc.so.5 (0x40013000)
    

This system uses libc5 and version 5 of the maths library. The lib5 ODBC-ODBC Bridge distribution is the one to choose in this case, therefore.

$ cc -o testlib testlib.c -lm
$ ldd ./testlib
libm.so.6 => /lib/libm.so.6 (0x40018000)
libc.so.6 => /lib/libc.so.6 (0x40035000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

This system uses glibc and version 6 of the maths library. The glibc ODBC-ODBC Bridge distribution is the one to choose in this case, therefore.

There is another glibc ODBC-ODBC Bridge distribution: the thread-safe version, which is linked with -lpthread (Linux Threads). Use this version if your application creates multiple threads. The threaded (thread-safe) ODBC-ODBC Bridge distributions have -mt in the distribution name.