Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: cannot open shared object file

by vinoth.ree (Monsignor)
on Apr 15, 2015 at 12:16 UTC ( [id://1123489]=note: print w/replies, xml ) Need Help??


in reply to cannot open shared object file

Hi,

Try force reinstall these two modules in the system where are getting this error message. DBI, DBD::mysql

KNOWN PROBLEMS

1)If Perl was compiled with gcc or egcs, but MySQL was compiled with another compiler or on another system, an error message like this is very likely when running ``Make test'':   t/00base............install_driver(mysql) failed: Can't load
  '../blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql:
  ../blib/arch/auto/DBD/mysql/mysql.so: undefined symbol: _umoddi3
  at /usr/local/perl-5.005/lib/5.005/i586-linux-thread/DynaLoader.pm
  line 168.

This means, that your linker doesn't include libgcc.a. You have the following options:

The solution is telling the linker to use libgcc. Run
  gcc --print-libgcc-file

to determine the exact location of libgcc.a or for older versions of gcc
  gcc -v

to determine the directory. If you know the directory, add a
  -L<directory> -lgcc

2)There are known problems with shared versions of libmysqlclient, at least on some Linux boxes. If you receive an error message similar to   install_driver(mysql) failed: Can't load
  '/usr/lib/perl5/site_perl/i586-linux/auto/DBD/mysql/mysql.so'
  for module DBD::mysql: File not found at
  /usr/lib/perl5/i586-linux/5.00404/DynaLoader.pm line 166

then this error message can be misleading: It's not mysql.so that fails being loaded, but libmysqlclient.so! The usual problem is that this file is located in a directory like
  /usr/lib/mysql

where the linker doesn't look for it.

The best workaround is using a statically linked mysqlclient library, for example
  /usr/lib/mysql/libmysqlclient.a

You force linking against this file by replacing
  -L/usr/lib/mysql -lmysqlclient

with
  /usr/lib/mysql/libmysqlclient.a


All is well. I learn by answering your questions...

Replies are listed 'Best First'.
Re^2: cannot open shared object file
by artperl (Acolyte) on Apr 15, 2015 at 14:56 UTC
    thanks for the inputs. i actually did force the installation of the required modules on the system with issue, & that is how I got the error message when running the script. Can you pleas guide me how I do the linking? which path & syntax to add the linking? thanks much!...

      Find the KNOWN PROBLEMS

      This link has the "Configuration" & "Linker flags". links read those will helpful.


      All is well. I learn by answering your questions...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1123489]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 01:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found