[unixODBC-support] Can't open lib error

Nick Gorham nick at lurcher.org
Thu Feb 23 15:41:08 GMT 2012


On 23/02/12 15:27, Franck Lebastard wrote:
> Hi Nick,
>
> It seems that you're right:
>
> $ ldd /usr/lib/odbc/libmyodbc5.1.10.so
> 	linux-gate.so.1 =>   (0xb7737000)
> 	libodbc.so.1 =>  not found
> 	libodbcinst.so.1 =>  /usr/lib/libodbcinst.so.1 (0xb73b4000)
> 	libpthread.so.0 =>  /lib/i686/cmov/libpthread.so.0 (0xb739a000)
> 	libm.so.6 =>  /lib/i686/cmov/libm.so.6 (0xb7374000)
> 	libdl.so.2 =>  /lib/i686/cmov/libdl.so.2 (0xb7370000)
> 	libc.so.6 =>  /lib/i686/cmov/libc.so.6 (0xb7215000)
> 	libltdl.so.3 =>  /usr/lib/libltdl.so.3 (0xb720e000)
> 	/lib/ld-linux.so.2 (0xb7738000)
>
> $ ldd /usr/lib/odbc/libmyodbc5-5.1.8.so
> 	linux-gate.so.1 =>   (0xb774f000)
> 	libcrypt.so.1 =>  /lib/i686/cmov/libcrypt.so.1 (0xb74f4000)
> 	libnsl.so.1 =>  /lib/i686/cmov/libnsl.so.1 (0xb74db000)
> 	libm.so.6 =>  /lib/i686/cmov/libm.so.6 (0xb74b4000)
> 	libodbcinst.so.1 =>  /usr/lib/libodbcinst.so.1 (0xb74a9000)
> 	libdl.so.2 =>  /lib/i686/cmov/libdl.so.2 (0xb74a5000)
> 	libpthread.so.0 =>  /lib/i686/cmov/libpthread.so.0 (0xb748c000)
> 	libc.so.6 =>  /lib/i686/cmov/libc.so.6 (0xb7331000)
> 	/lib/ld-linux.so.2 (0xb7750000)
> 	libltdl.so.3 =>  /usr/lib/libltdl.so.3 (0xb7329000)
>
> $ ll /usr/lib/libodbc*
> lrwxrwxrwx 1 root root    20 aoû 12  2009 /usr/lib/libodbcinst.so.1 ->
> libodbcinst.so.1.0.0
> -rw-r--r-- 1 root root 41108 jui 27  2007 /usr/lib/libodbcinst.so.1.0.0
>
> $ ll /usr/local/lib/libodbc*
> -rwxr-xr-x 1 root staff     970 jan 13 11:43 /usr/local/lib/libodbccr.la
> lrwxrwxrwx 1 root staff      18 jan 13 11:43 /usr/local/lib/libodbccr.so ->
> libodbccr.so.2.0.0
> lrwxrwxrwx 1 root staff      18 jan 13 11:43 /usr/local/lib/libodbccr.so.2
> ->  libodbccr.so.2.0.0
> -rwxr-xr-x 1 root staff  491573 jan 13 11:43
> /usr/local/lib/libodbccr.so.2.0.0
> -rwxr-xr-x 1 root staff     982 jan 13 11:43 /usr/local/lib/libodbcinst.la
> lrwxrwxrwx 1 root staff      20 jan 13 11:43 /usr/local/lib/libodbcinst.so
> ->  libodbcinst.so.2.0.0
> lrwxrwxrwx 1 root staff      20 jan 13 11:43 /usr/local/lib/libodbcinst.so.2
> ->  libodbcinst.so.2.0.0
> -rwxr-xr-x 1 root staff  432502 jan 13 11:43
> /usr/local/lib/libodbcinst.so.2.0.0
> -rwxr-xr-x 1 root staff     958 jan 13 11:43 /usr/local/lib/libodbc.la
> lrwxrwxrwx 1 root staff      16 jan 13 11:43 /usr/local/lib/libodbc.so ->
> libodbc.so.2.0.0
> lrwxrwxrwx 1 root staff      16 jan 13 11:43 /usr/local/lib/libodbc.so.2 ->
> libodbc.so.2.0.0
> -rwxr-xr-x 1 root staff 1751995 jan 13 11:43 /usr/local/lib/libodbc.so.2.0.0
>
> I understand that my current MySQL driver is using an old release of
> libodbcinst, lost alone in /usr/lib while all new unixODBC libraries are in
> /usr/local/lib... Too bad...
>
> So what to do ? Should I clean /usr/lib and install latest unixODBC so.1
> libraries (with so.2 libraries) in /usr/local/lib ? If you agree, where can
> I get those latest unixODBC.so.1 libraries ?
>
> Thanks for your help,
> Best regards,
> Franck

The clean solution is to remove all the /usr/lib libaries that are part 
of unxiODBC, Then create symbolic links in /usr/local/lib to the .so.2 
libs to resolve older driver builds.

cd /usr/local/lib
ln -s libodbc.so.1 libodbc.so
ln -s libodbcinst.so.1 libodbcinst.so
ln -s libodbccr.so.1 libodbccr.so

One day things will catch up. Changing the version was the cause of the 
problem, but it was the correct thing to do. Hopefully driver writers 
will eventually check that sizeof( SQLLEN ) == 64 with 64 bit builds, 
build against unixODBC-2.3.1 or later and all will be well.

-- 
Nick


More information about the unixODBC-support mailing list