Craig Metzer wrote:
Martin,
Thanks for the reply.
I'm not sure I understand the problem with the .a files. How would I go about
makeing it use teh .la?
That was just example showing what happens when the gnu linker hits a 32
bit .a when it is attempting to do a 64 bit build - I was not suggesting
you need to use .la files as you are not using configure and libtool.
Would I have to mod the Makefile?
I have two versions of libodbc one 32 and another 64.
The paths that Makefile chose were the 32-bit ... should I mod these to use the
lib64 instead?
It looked to me that your perl was 64 bit and hence you need to point
DBD::ODBC at the 64 bit unixODBC. That might be a little tricky as it
stands without editing the makefile as you look like you want DBD::ODBC
to look in /usr/lib64 for libodbc.so but /usr/include for the header
files and DBD::ODBC only supports specifying the one location for the
driver/driver_manager.
I'd do a perl Makefile.PL with ODBCHOME set to /usr then edit the
makefile for now and change the -L/usr/lib to -L/usr/lib64.
Thanks for the help.
Craig
~~~~ file output ~~~~~~
[EMAIL PROTECTED] DBD-ODBC-1.13]# file
/usr/lib64/libodbc.so/usr/lib64/libodbc.so: symbolic link to
`libodbc.so.1.0.0'[EMAIL PROTECTED] DBD-ODBC-1.13]# file
/usr/lib64/libodbc.so.1.0.0/usr/lib64/libodbc.so.1.0.0: ELF 64-bit LSB shared
object, AMD x86-64, version 1 (SYSV), [EMAIL PROTECTED] DBD-ODBC-1.13]# file
/usr/lib/libodbc.so/usr/lib/libodbc.so: symbolic link to
`libodbc.so.1.0.0'[EMAIL PROTECTED] DBD-ODBC-1.13]# file
/usr/lib/libodbc.so.1.0.0/usr/lib/libodbc.so.1.0.0: ELF 32-bit LSB shared
object, Intel 80386, version 1 (SYSV), stripped
Date: Fri, 13 Jul 2007 16:26:26 +0100> From: [EMAIL PROTECTED]> To: [email protected]> Subject: Re: Trouble Installing ODBC 1.13 on Linux 64> > Craig Metzer wrote:> > > >
Hope you all are having a pleasant summer.> > > > I am ... just a little trouble installing ODBC for Perl 5.8.5. Perhaps someone can help me out.> > > > I get an error on make
.. it appears to be in building ODBC.so:> > > > gcc -shared ODBC.o dbdimp.o -o blib/arch/auto/DBD/ODBC/ODBC.so -L/usr/lib -lodbc/usr/bin/ld: skipping incompatible /usr/lib/libodbc.so when
searching for -lodbc/usr/lib/libodbc.a: could not read symbols: Bad valuecollect2: ld returned 1 exit statusmake: *** [blib/arch/auto/DBD/ODBC/ODBC.so] Error 1> > TIA,> > Craig> >
Washington DC> > > > ~~~~ output ~~~~~~~~~> > [EMAIL PROTECTED] DBD-ODBC-1.13]$ perl Makefile.PLUseless use of private variable in void context at Makefile.PL line 431.> >
Configuring DBD::ODBC ...> >>>> Remember to actually *READ* the README file! And re-read i
t if you have any problems.> > Multiple copies of Driver.xst found in: /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto/DBI/ /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/DBI/ at Makefile.PL line 61Using DBI 1.58 (for perl 5.008005 on x86_64-linux-thread-multi) installed in /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto/DBI/Using ODBC in /usr> > Umm, this looks like a unixodbc type of driver manager.We expect to find the sql.h, sqlext.h and (which weresupplied with unixODBC) in $ODBCHOME/include directory alongsidethe /usr/lib/libodbc.a /usr/lib/libodbc.so library. in $ODBCHOME/lib> > Checking if your kit is complete...Looks goodInjecting selected odbc driver into cc commandInjecting selected odbc driver into cc commandMultiple copies of Driver.xst found in: /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto/DBI/ /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/DBI/ at Makefile.PL line 462Using
DBI 1.58 (for perl 5.008005 on x86_64-linux-thread-multi) installed in /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto/DBI/Writing Makefile for DBD::ODBC> > The DBD::ODBC tests will use these values for the database connection: DBI_DSN=dbi:ODBC:pgsql e.g. dbi:ODBC:demo DBI_USER=postgres DBI_PASS=postgres> > [EMAIL PROTECTED] DBD-ODBC-1.13]$ makecp Changes blib/lib/DBD/ODBC/Changes.pmcp ODBC.pm blib/lib/DBD/ODBC.pm/usr/bin/perl -p -e "s/~DRIVER~/ODBC/g" /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto/DBI/Driver.xst > ODBC.xsi/usr/bin/perl /usr/lib/perl5/5.8.5/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.5/ExtUtils/typemap ODBC.xs > ODBC.xsc && mv ODBC.xsc ODBC.cWarning: duplicate function definition 'data_sources' detected in ODBC.xs, line 202gcc -c -I/usr/include -I. -I/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_
FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m64 -DVERSION=\"1.13\" -DXS_VERSION=\"1.13\" -fPIC
"-I/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE" -I/usr/include ODBC.cgcc -c -I/usr/include -I.
-I/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -DDEBUGGI> NG -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m64 -DVERSION=\"1.13\"
-DXS_VERSION=\"1.13\" -fPIC "-I/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE" -I/usr/include dbdimp.cdbdimp.c: In
function `odbc_db_STORE_attrib':dbdimp.c:3108: warning: cast from pointer to integer of different sizedbdimp.c: In function
`odbc_db_FETCH_attrib':dbdimp.c:3440: warning: cast to pointer from integer of different sizeRunning Mkbootstrap for DBD::ODBC ()chmod 644
ODBC.bsrm -f blib/arch/auto/DBD/ODBC/ODBC.sogcc -shared ODBC.o dbdimp.o -o blib/arch/auto/DBD/ODBC/ODBC.so -L/usr/lib -lodbc/usr/bin/ld:
skipping incompatible /usr/lib/libodbc.so when searching for -lodbc/usr/lib/libodbc.a: could not read symbols: Bad valuecollect2: ld returned 1 exit statusmake: ***
[blib/arch/auto/DBD/ODBC/ODBC.so] Error 1> > > > [EMAIL PROTECTED] DBD-ODBC-1.13]$ ls -l $ODBCHOME/include/sql*.h-rw-r--r-- 1 root root 31945 Nov 21 2005
/usr/include/sql.h-rw-r--r-- 1 root root 1007 Feb 16 2006 /usr/include/sql3types.h-rw-r--r-- 1 root root 1258 Feb 16 2006 /usr/include/sqlca.h-rw-r--r-- 1 root root
78402 Nov 21 2005 /usr/include/sqlext.h-rw-r--r-- 1 root root 11165 Nov 21 2005 /usr/include/sqltypes.h-rw-r--r-- 1 root root 21671 Nov 21 2005
/usr/include/sqlucode.h> > > > [EMAIL PROTECTED] DBD-ODBC-1.13]$ exportdeclare -x DBI_DSN="dbi:ODBC:pgsql"declare -x
DBI_PASS="postgres"declare -x DBI_USER="postgres"declare -x LANG="C"declare -x
LD_LIBRARY_PATH="/usr:/usr/lib/pgsql:/lib:/lib64"declare -x ODBCHOME="/usr"declare -x
PATH="/sbin:/usr/sbin:/usr/local/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/
usr/bin:/usr/X11R6/bin:/usr/local/pgsql/bin:/opt/CSCOnfc/bin:/opt/CSCOnfc/tools:/usr/local/mrtg-2/bin:/home/mrtg/bin:./"declare -x
POSTGRES_INCLUDE="/usr/include/pgsql"declare -x POSTGRES_LIB="/usr/lib64/pgsql"declare -x
QTDIR="/usr/lib64/qt-3.3"declare -x SHELL="/bin/bash"declare -x TERM="xterm"> > > > [EMAIL PROTECTED]
DBD-ODBC-1.13]$ perl -VSummary of my perl5 (revision 5 version 8 subversion 5) configuration: Platform: osname=linux,
osvers=2.6.9-22.18.bz155725.elsmp, archname=x86_64-linux-thread-multi uname='linux hs20-bc1-3.build.redhat.com 2.6.9-22.18.bz155725.elsmp #1 smp
thu nov 17 15:34:08 est 2005 x86_64 x86_64 x86_64 gnulinux ' config_args='-des -Doptimize=-O2 -g -pipe -m64 -Dversion=5.8.5 -Dmyhostname=localhost
[EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64
-Dprivlib=/usr/lib/perl5/5.8.5 -Dsitelib=/usr/lib/perl5/site_perl/5.8.5 -Dvendorlib=/usr/lib/perl5/vendor_perl/5.8.5 -D
archlib=/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi
-Dsitearch=/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi
-Dvendorarch=/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi
-Darchname=x86_64-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib
-Dusethreads -Dus> eithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db
-Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio
-Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr
-Dinc_version_list=5.8.4 5.8.3 5.8.2 5.8.1 5.8.0' hint=recommended, useposix=true,
d_sigaction=define usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define
usesocks=undef use64bitint=define use64bitall=define uselongdouble=undef
usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT
-D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFS
ET_BITS=64 -I/usr/include/gdbm', optimize='-O2 -g -pipe -m64',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe
-I/usr/local/include -I/usr/include/gdbm' ccversion='', gccversion='3.4.6 20060404
(Red Hat 3.4.6-2)', gccosandvers='' intsiz> e=4, longsize=8, ptrsize=8,
doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8,
d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double',
nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and
Libraries: ld='gcc', ldflags ='' libpth=/usr/local/lib64 /lib64 /usr/lib64
libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.3.3.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.4' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so,
d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlfla
gs='-shared'> > Characteristics of this binary (from libperl): Compile-time
options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_64_BIT_INT USE_64_BIT_ALL
USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under linux Compiled at Jul 24 2006 18:28:14
@INC: /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/5.8.5
/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi
/usr/lib64/perl5/site_perl/5.8.4/x86_64-linux-thread-multi
/usr/lib64/perl5/site_perl/5.8.3/x86_64-linux-thread-multi
/usr/lib64/perl5/site_perl/5.8.2/x86_64-linux-thread-multi
/usr/lib64/perl5/site_perl/5.8.1/x86_64-linux-thread-multi
/usr/lib64/perl5/site_perl/5.8.0/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4
/usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2
/usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/li>
b64/perl5/vendor_perl/5.8.4/x86_64-linu
x-thread-multi /usr/lib64/perl5/vendor_perl/5.8.3/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.2/x86_64-linux-thread-multi
/usr/lib64/perl5/vendor_perl/5.8.1/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.0/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2
/usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .> > > > A quick search on google
shows this is will happen on 64bit Linux when > you attempt to use a .a (just search for "could not read symbols: Bad > value
collect2") and you'll find stuff like:> > http://linuxfromscratch.org/pipermail/cross-lfs/2006-March/001659.html> > I
think your actual issue though is "/usr/bin/ld: skipping incompatible > /usr/lib/libodbc.so when searching for -lodbc" which
suggests your > dynamically built libodbc.so shared object is not built the same as your > perl i.e. on
e is 32bit and the other is 64bit. A quick "file libodbc.so" > should tell you for sure. You need a
shared object of libodbc.so built > the same as your Perl.> > Martin> -- > Martin J. Evans>
Easysoft Limited> http://www.easysoft.com
_________________________________________________________________
If that works let me know as we'll have to modify DBD::ODBC in the long
term to cope with looking in two independent places.
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com