[unixODBC-support] Can't open lib error

Franck Lebastard Franck.Lebastard at inovmedia.com
Thu Feb 23 15:27:16 GMT 2012


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

-----Message d'origine-----
De : unixodbc-support-bounces at mailman.unixodbc.org
[mailto:unixodbc-support-bounces at mailman.unixodbc.org] De la part de Nick
Gorham
Envoyé : jeudi 23 février 2012 15:26
À : Support for the unixODBC project
Objet : Re: [unixODBC-support] Can't open lib error

On 23/02/12 13:51, Franck Lebastard wrote:
> Hi all,
>
>
>
> I am using unixODBC 2.3.1 on Debian lenny (uname –a: Linux voyager
> 2.6.26-2-686 #1 SMP Wed Sep 21 04:35:47 UTC 2011 i686 GNU/Linux) with 
> MySQL
> (server: 5.0.51a-24+lenny5) and it works great (thanks all!).
>
>
>
> Recently, I decided to update MySQL driver and I downloaded the last 
> release (mysql-connector-odbc-5.1.10-linux-glibc2.3-x86-32bit.tar.gz). 
> I installed it correctly using odbcinst but I was not able to use it.
>
>
>
> SQLConnect definitively generates the following error:
>
>
>
> ODBC SQLConnect error code= -1 [SQLState='01000' 
> SQLMsg='[unixODBC][Driver Manager]Can't open lib
'/usr/lib/odbc/libmyodbc5.1.10.so' : file not found'
> ]
>
>
>
> In the past, with the current driver, I also (rarely) got the same 
> ‘file not found’ error for an SQLConnect call among others.
>
>
>
> Once, the same error happened and then definitely occurred for all 
> next calls to SQLConnect. I had to kill the application and re-run it 
> to get SQLConnect working again.
>
Try a ldd on the lib. It may be that the driver is linked against
libodbcinst.so.1 and 2.3.1 provides libodbcinst.so.2

The version change was because of the API change that 64 bit SQLLEN
involved. But in most cases, linking the so.2 and so.1 libs so both names
are pointing to the same file will sort the problem out.

--
NIck
_______________________________________________
unixODBC-support mailing list
unixODBC-support at mailman.unixodbc.org
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support



More information about the unixODBC-support mailing list