[unixODBC-support] problem with undefined symbols

Martin J. Evans bohica at ntlworld.com
Mon Jul 7 18:39:08 BST 2014


On 07/07/2014 17:34, Breazeale, Joel L - Eagan, MN - Contractor wrote:
> Folks,
>
> I am using Perl 5.10.0-64.67.52, perl-DBD-ODBC 1.17-1.15, unixODBC
> 2.2.12-198.17 on SUSE Enterprise 11.

That version of DBD::ODBC is sooo old (sep 2008 - 8 years old). The 
current version is 1.48 or 1.49 development release.

> I have set the OOBCSYSINI environment variable to ~/.odbcsysinst and
> have the following files in that directory:
>
> odbc.ini:
>
> Driver=SQL Server
>
> Description=ESMWI Database
>
> Database=ESMWI
>
> Server=ESMHOST
>
> Port=1433
>
> User=USER
>
> Password=PW
>
> Trace=Yes
>
> TraceFile=/tmp/ESMWI.log
>
> edbcinst.ini:
>
> [SQL Server]
>
> Description=Microsoft SQL Server
>
> Driver=/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so

As Nick said, don't do this. DBD::ODBC is not an ODBC driver it is a 
Database Driver for Perl which is run under Perl's DBI. You need to 
install a Microsoft SQL Server driver and the Driver attribute in your 
odbc.ini should point to that.


> FileUsage=1
>
> CommLog=1
>
> These are the two problems I’m seeing when trying to connect to the
> ESMWI database:
>
>  From Perl:
>
>> updpconfig.pl -he
>
> DBI connect('ESMWI','USER',...) failed: [unixODBC][Driver
> Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed (SQL-IM004) at
> /home/k5ycc0/bin/updpconfig.pl line 86

I'm guessing this happened as you pointed unixODBC at a shared object 
(DBD::ODBC) which does not even contain the symbol for SQLAllocHandle - 
as it wouldn't as it is not an ODBC driver.

>>
>
>  From isql:
>
>> isql -v ESMWI
>
> [01000][unixODBC][Driver Manager]Can't open lib
> '/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so'
> : file not found
>
> [ISQL]ERROR: Could not SQLConnect
>
>>
>
> I’ve been looking around a lot for the solution to these two problems
> and have seen a lot, but nothing on my side parallels the problems I’ve
> seen so far.  However, I did find one thing…
>
> If you look at the following output you’ll see a bunch of undefined symbols:
>
>> ldd --data-relocs --unused --verbose --function-relocs /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so
>
>        6413:
> /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so:
> error: symbol lookup error: undefined symbol: PL_no_modify (continued)
>
> undefined symbol: PL_no_modify
> (/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so)
>
>        6413:
> /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so:
> error: symbol lookup error: undefined symbol: PL_memory_wrap (continued)
>
> undefined symbol: PL_memory_wrap
> (/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so)
>
>        6413:
> /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so:
> error: symbol lookup error: undefined symbol: Perl_hv_iterinit (continued)
>
> undefined symbol: Perl_hv_iterinit
> (/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so)
>
>        6413:
> /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so:
> error: symbol lookup error: undefined symbol: Perl_mg_get (continued)
>
> . . .
>
> undefined symbol: Perl_markstack_grow
> (/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so)
>
>        6413:
> /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so:
> error: symbol lookup error: undefined symbol: Perl_newRV (continued)
>
> undefined symbol: Perl_newRV
> (/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so)
>
>        6413:
> /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so:
> error: symbol lookup error: undefined symbol: Perl_sv_backoff (continued)
>
> undefined symbol: Perl_sv_backoff
> (/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so)
>
>        6413:
> /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so:
> error: symbol lookup error: undefined symbol: Perl_dowantarray (continued)
>
> undefined symbol: Perl_dowantarray
> (/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so)
>
>        6413:
> /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so:
> error: symbol lookup error: undefined symbol: Perl_sv_2pv_flags (continued)
>
> undefined symbol: Perl_sv_2pv_flags
> (/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/ODBC/ODBC.so)
>
> Unused direct dependencies:

Those symbols are in perl itself.
>>
>
> Can any of you give me a roadmap on how to resolve my Perl connection
> issue using the evidence presented?
>
> Thank you!
>
> --Joel

1. Install an ODBC driver
2. Point your odbcinst.ini and odbc.ini at it.

That's it.

Martin
-- 
Martin J. Evans
Wetherby, UK


More information about the unixODBC-support mailing list