0

install_driver(ODBC) failed:

Can't load '/usr/local/lib/perl5/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: libodbc.so.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/DynaLoader.pm line 200. at (eval 3) line 3 Compilation failed in require at (eval 3) line 3. Perhaps a required shared library or dll isn't installed where expected at M_BLACKLIST.pl line 14

I have using latest unixodbc dbi drvier. Basically i use centos 6.

user1363308
  • 938
  • 4
  • 14
  • 33
  • Are you sure you've installed the unixODBC Driver Manager package? Did you build DBD::ODBC yourself or did you install it via a package? – bohica Apr 03 '13 at 10:18
  • i have installed DBD::ODBC via package – user1363308 Apr 03 '13 at 10:35
  • 1
    And did you install the unixodbc packages DBD::ODBC relies upon. I don't use Centos so I'm not sure what package manager it uses. The error you are getting says DBD::ODBC depends on the unixodbc driver manager shared object and it was not found in your dynamic linker path. You need libodbc.so (from the unixodbc package). Do ldd /usr/local/lib/perl5/auto/DBD/ODBC/ODBC.so and you'll see what shared objects it needs and what wasn't found. – bohica Apr 03 '13 at 10:39
  • Try typing "yum list installed" and pipe it into a grep -i unixodbc e.g. yum list installed | grep -i unixodbc. What does it output? – bohica Apr 03 '13 at 10:47
  • ldd /usr/local/lib/perl5/auto/DBD/ODBC/ODBC.so linux-gate.so.1 => (0x001a2000) libodbc.so.1 => not found libc.so.6 => /lib/libc.so.6 (0x003a0000) /lib/ld-linux.so.2 (0x00912000) – user1363308 Apr 03 '13 at 10:56
  • yum list installed | grep -i unixodbc unixODBC.i686 2.2.14-11.el6 @anaconda-centos-201106051823.i386/6.0 unixODBC-devel.i686 2.2.14-11.el6 @anaconda-centos-201106051823.i386/6.0 – user1363308 Apr 03 '13 at 10:56

1 Answers1

0

Just be aware, that the latest unixODBC build will create libodbc.so.2, the number was incremented after the SQLLEN change to the api a year or so ago May not be the problem, but worth checking what libodbc.so you actually have.

Nick Gorham
  • 1,118
  • 8
  • 9
  • currently i have using following libodbc.so : /usr/lib/libodbc.so /usr/lib/libodbc.so.2 /usr/lib/libodbc.so.2.0.0 /usr/local/lib/libodbc.so /usr/local/lib/libodbc.so.1 /usr/local/lib/libodbc.so.1.0.0 /usr/src/asterisk/unixODBC-2.2.12/DriverManager/.libs/libodbc.so /usr/src/asterisk/unixODBC-2.2.12/DriverManager/.libs/libodbc.so.1 /usr/src/asterisk/unixODBC-2.2.12/DriverManager/.libs/libodbc.so.1.0.0 please suggest me how i can solve the problem – user1363308 Apr 03 '13 at 12:51
  • 1
    I would imagine /usr/local/lib is not on your dynamic linker search path as the file ODBC.so requires is libodbc.so.1 and you have that in /usr/local/lib. Try doing export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib then running your Perl. – bohica Apr 03 '13 at 14:56