[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetds
Subject:    [freetds] Re: Error running freetds to access SQL Server
From:       "John Ireland" <J.Ireland () hgu ! mrc ! ac ! uk>
Date:       2001-01-31 15:27:32
[Download RAW message or body]

Hello

I have had a similar problem which I solved by adding '-lct' to the
DBD-Sybase-0.91 Makefile.PL (see the diff below).  This causes 'libtds.so'
to be included in the perl shared library 'Sybase.so' resolving the
unreferenced symbols. 'ldd' and 'nm' help show the various dependencies.

% ldd -d Sybase.so
        libtds.so.0 =>   /opt/freetds/lib/libtds.so.0
        libct.so.0 =>    /opt/freetds/lib/libct.so.0

% nm libct.so.0 | fgrep g_tds
[133]   |         0|       0|NOTY |GLOB |0    |UNDEF  |g_tds_err_handler
[209]   |         0|       0|NOTY |GLOB |0    |UNDEF  |g_tds_msg_handler
% nm libtds.so.0 | fgrep g_tds
[276]   |    155568|       4|OBJT |GLOB |0    |14     |g_tds_err_handler
[425]   |    155572|       4|OBJT |GLOB |0    |14     |g_tds_msg_handler
 

It took me ages to figure it out!

Regards 

John Ireland

MRC Human Genetics Unit
Edinburgh
Scotland

 

110c110
< $lib_string = "-L$SYBASE/lib -lct -lcs -ltcl -lcomn -lintl $attr{EXTRA_LIBS} -lm";
---
> $lib_string = "-L$SYBASE/lib -ltds -lct -lcs -ltcl -lcomn -lintl $attr{EXTRA_LIBS} -lm";
112c112
< $lib_string = "-L$SYBASE/lib -lct -lcs -ltcl -lcomn -lintl $extra -lm";
---
> $lib_string = "-L$SYBASE/lib -ltds -lct -lcs -ltcl -lcomn -lintl $extra -lm";


> I installed freetds-0.51 on SUN sparc to access data from SQL Server 6.5
> on an NT box. I also installed DBD-Sybase-0.91. We already have perl DBI
> on this machine.
> 
> When I tried to test my script,
> 
> use DBI;
>                    $ENV{'SYBASE'} = '/usr/local/freetds';
>                    $dbh =
> DBI->connect('dbi:Sybase:server=myserver','uid','pword')
>                        or die 'connect';
>                    $dbh->do("use pubs");
>                    $sth = $dbh->prepare('select * from authors') or die
> 'prepare';
>                    $sth->execute or die 'execute';
>                    while (@data = $sth->fetchrow_array) {
>                        print "$data[0]\n"; # the authors' SSNs
>                    }
>                    $sth->finish;
>                    $dbh->disconnect;
> 
> I get this error:
> 
> install_driver(Sybase) failed: Can't load
> '/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/DBD/Sybase/Sybase.so'
> for module DBD::Sybase: ld.so.1: /usr/bin/perl: fatal: relocation
> error:file /usr/local/freetds/lib/libct.so.0: symbol g_tds_err_handler:
> referenced symbol not found at
> /usr/local/lib/perl5/5.00503/sun4-solaris/DynaLoader.pm line 169, <IN> chunk
> 2.
> 
>  at (eval 4) line 3
>         Carp::croak('Can\'t load
> \'/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/...') called at
> /usr/local/lib/perl5/5.
> 00503/sun4-solaris/DynaLoader.pm line 93
>         DynaLoader::croak('Can\'t load
> \'/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/...') called at
> /usr/local/lib/pe
> rl5/5.00503/sun4-solaris/DynaLoader.pm line 169
>         DynaLoader::bootstrap('DBD::Sybase', 0.91) called at
> /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/DBD/Sybase.pm
> 
> Can someone please help me with this error?
> 
> Thanks,
> girija

---
You are currently subscribed to freetds as: [freetds@progressive-comp.com]
To unsubscribe, forward this message to leave-freetds-113879Q@franklin.oit.unc.edu

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic