[unixODBC-support] odbcinst failing

Davies Matt J A (LCSS) mjdavies at glam.ac.uk
Thu Jul 28 13:36:34 BST 2011


Hi Nick

This is a super clean install

Here's where I am so far, I'll share :-)  You got any advice?  I'm tempted
to try the 2.2.11 version.

I can't write the article if I can't use the software :-(



In this article I'm going to build a 64 bit ubuntu 10 os, and then install
32 bit unixodbc and get it to connect to a remote odbc data source using a
third party 32 bit driver.

I'm building the OS with VMware Fusion on my mac using
ubuntu-10.04.2-server-amd64.iso

Do not install any additional packages during the OS install

sudo locale-gen en_GB.UTF-8
sudo /usr/sbin/update-locale LANG=en_GB.UTF-8
sudo aptitude update
sudo aptitude safe-upgrade
sudo reboot
sudo aptitude -y install ssh
sudo aptitude install build-essential linux-headers-`uname -r`
sudo ln -s /usr/src/linux-headers-`uname -r` /usr/src/linux
sudo reboot
sudo aptitude install ia32-libs
sudo apt-get install g++-multilib
mkdir ~/src
cd ~/src
wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.0.tar.gz
tar -xzvf unixODBC-2.3.0.tar.gz
cd unixODBC-2.3.0/
CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 ./configure
make
sudo make install

That has installed the 32 bit software into /usr/local/lib, you can
confirm that by running

file /usr/local/lib/libodbcinst.so.1.0.0

should say

lib/libodbcinst.so.1.0.0: ELF 32-bit LSB shared object, Intel 80386,
version 1 (SYSV), dynamically linked, not stripped

We're now going to upload the sassafras driver into that directory and
test it

nonrootuser at 64bitubuntu10:/usr/local$ ldd /usr/local/lib/libksodbc.dbg.so
	linux-gate.so.1 =>  (0xf770e000)
	libgssapi_krb5.so.2 => /usr/lib32/libgssapi_krb5.so.2 (0xf7632000)
	libm.so.6 => /lib32/libm.so.6 (0xf760c000)
	libc.so.6 => /lib32/libc.so.6 (0xf74b1000)
	libkrb5.so.3 => /usr/lib32/libkrb5.so.3 (0xf7400000)
	libk5crypto.so.3 => /usr/lib32/libk5crypto.so.3 (0xf73dc000)
	libcom_err.so.2 => /lib32/libcom_err.so.2 (0xf73d8000)
	libkrb5support.so.0 => /usr/lib32/libkrb5support.so.0 (0xf73d0000)
	libdl.so.2 => /lib32/libdl.so.2 (0xf73cb000)
	libkeyutils.so.1 => /lib32/libkeyutils.so.1 (0xf73c7000)
	libresolv.so.2 => /lib32/libresolv.so.2 (0xf73b3000)
	/lib/ld-linux.so.2 (0xf770f000)
	libpthread.so.0 => /lib32/libpthread.so.0 (0xf739a000)

Voila, it all looks rosey in the garden.

Now we need to define our odbc connections in odbc.ini and odbcinst.ini

Lets test

odbcinst -j
unixODBC 2.3.0
odbcinst: symbol lookup error: odbcinst: undefined symbol:
odbcinst_system_file_name

uh oh, that looks bad

which odbcinst
/usr/local/bin/odbcinst
file /usr/local/bin/odbcinst
/usr/local/bin/odbcinst: ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not
stripped


No problem there

Maybe we need the unixodbc-dev packages installed as 32 bit too?

cd ~/src/
wget 
http://ubuntu.mirror.cambrium.nl/ubuntu//pool/main/u/unixodbc/unixodbc-dev_
2.2.11-21_i386.deb
sudo dpkg --force-architecture -i unixodbc-dev_2.2.11-21_i386.deb[sudo]
password for nonrootuser:
dpkg: warning: overriding problem because --force enabled:
 package architecture (i386) does not match system (amd64)
Selecting previously deselected package unixodbc-dev.
(Reading database ... 51588 files and directories currently installed.)
Unpacking unixodbc-dev (from unixodbc-dev_2.2.11-21_i386.deb) ...
dpkg: dependency problems prevent configuration of unixodbc-dev:
 unixodbc-dev depends on unixodbc (= 2.2.11-21); however:
  Package unixodbc is not installed.
 unixodbc-dev depends on odbcinst1debian1 (= 2.2.11-21); however:
  Package odbcinst1debian1 is not installed.
 unixodbc-dev depends on libodbcinstq1c2 (= 2.2.11-21); however:
  Package libodbcinstq1c2 is not installed.
 unixodbc-dev depends on libltdl3-dev; however:
  Package libltdl3-dev is not installed.
dpkg: error processing unixodbc-dev (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 unixodbc-dev



On 28/07/2011 13:28, "Nick Gorham" <nick at lurcher.org> wrote:

>On 28/07/11 13:16, Davies Matt J A (LCSS) wrote:
>> Ok I spoke to soon, that page is now back :-)
>>
>> So I just download the adm64 .deb file, and then somehow install that as
>> 32 bit?
>>
>> Am I on the right track here?
>>
>Not sure, as I am a bit unclear what the goal is. I would expect that
>missing symbol to be caused by a mix of binaries and libraries from
>different versions of unixODBC. I would try to just have the one version
>of the libs and bins installed at any time, doesn't matter what it is
>(though 2.3.0 has less bugs and is some years more current). But if you
>are trying to just produce some instructions I would start with a clean
>box and work from there. Trying to create user docs from a machine that
>is used for development is often a path to pain.
>
>-- 
>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