minixman has asked for the wisdom of the Perl Monks concerning the following question:

All i have the following code i want to load the DBD::Informix driver.
#!/apps/exlink/orc/perl/bin/perl use DBD::Informix;


When i run it i get
bash-3.00$ perl/bin/perl test.pl Can't load '/apps/exlink/orc/arch/sparc-sun-solaris/perl/lib/site_perl +/5.8.5/sun4-solaris/auto/DBD/Informix/Informix.so' for module DBD::In +formix: ld.so.1: perl: fatal: libifsql.so: open failed: No such file +or directory at /apps/exlink/orc/arch/sparc-sun-solaris/perl/lib/5.8. +5/sun4-solaris/DynaLoader.pm line 230. at test.pl line 3 Compilation failed in require at test.pl line 3. BEGIN failed--compilation aborted at test.pl line 3.

So i setup the LD_LIBRARY_PATH to put my libifsql.so in.
bash-3.00$ find . -name libifsql.so ./arch/sparc-sun-solaris/lib/32/libifsql.so ./arch/sparc-sun-solaris/lib/64/libifsql.so ./arch/x86_64-unknown-linux/lib/32/libifsql.so ./arch/x86_64-unknown-linux/lib/64/libifsql.so bash-3.00$ export LD_LIBRARY_PATH=./arch/sparc-sun-solaris/lib/64/libi +fsql.so bash-3.00$ perl/bin/perl test.pl Can't load '/apps/exlink/orc/arch/sparc-sun-solaris/perl/lib/site_perl +/5.8.5/sun4-solaris/auto/DBD/Informix/Informix.so' for module DBD::In +formix: ld.so.1: perl: fatal: libifsql.so: open failed: No such file +or directory at /apps/exlink/orc/arch/sparc-sun-solaris/perl/lib/5.8. +5/sun4-solaris/DynaLoader.pm line 230. at test.pl line 3 Compilation failed in require at test.pl line 3. BEGIN failed--compilation aborted at test.pl line 3. bash-3.00$ more test.pl

But i still get the same error, does perl not use the LD_LIBRARY_PATH to search for this lib ?

Replies are listed 'Best First'.
Re: DBD::Informix ld.so.1 unable to find .so file
by gellyfish (Monsignor) on May 11, 2006 at 09:58 UTC

    I don't think that you want to put the full path of the dynamic library but to the directory it is in, the DBD::Informix will need other libraries beyond libifsql.so I'm pretty sure.

    As a matter of interest how did you manage to build the DBD::Informix like this, my recollection was that is built a small ESQL/C program to check whether the build environment would work.

    /J\

      Yes sorry i changed the ld_library path to export LD_LIBRARY_PATH=./arch/sparc-sun-solaris/lib/64
      But i still get the same error.
      Can't load '/apps/exlink/orc/arch/sparc-sun-solaris/perl/lib/site_perl +/5.8.5/sun4-solaris/auto/DBD/Informix/Informix.so' for module DBD::In +formix: ld.so.1: perl: fatal: libifsql.so: open failed: No such file +or directory at /apps/exlink/orc/arch/sparc-sun-solaris/perl/lib/5.8. +5/sun4-solaris/DynaLoader.pm line 230. at test.pl line 3 Compilation failed in require at test.pl line 3. BEGIN failed--compilation aborted at test.pl line 3.
      This build was done by someone else i have just seen that DBD::Informix has been installed in the perl dist, and i am trying to use it. It is strange that i can't.

        Ah, I didn't notice before because of the tiny font I appear to have set on this screen but you have a relative path set for the LD_LIBRARY_PATH, I don't think you can guarantee that the dynamic loader will have the same working directory as you, so you should put the full path to the informix libraries, this will normally be rooted in $INFORMIXDIR which almost certainly must be set for the libraries to find the sqlhosts file and so forth. I have the equivalent of an LD_LIBRARY_PATH of:

        $INFORMIXDIR/lib/cli:$INFORMIXDIR/lib:$INFORMIXDIR/lib/esql
        but you probably will need to check with the person that installed the Informix Client-SDK. You might also consider asking in the newsgroup comp.databases.informix as I for one haven't used Informix on Solaris for a number of years now.

        /J\

Re: DBD::Informix ld.so.1 unable to find .so file
by tweetiepooh (Hermit) on May 11, 2006 at 12:33 UTC
    First does
    ldd /apps/exlink/orc/arch/sparc-sun-solaris/perl/lib/site_perl +/5.8.5/sun4-solaris/auto/DBD/Informix/Informix.so
    find the library.

    Try using the whole path rather than relative.

    Ensure that everything is the same "type". Ensure that perl, module and library are all 32 or 64 bit

Re: DBD::Informix ld.so.1 unable to find .so file
by chargrill (Parson) on May 11, 2006 at 18:54 UTC

    For a more permanent solution on solaris, try setting the lib search path default to include /path/to/arch/sparc-sun-solaris/lib/32/ (etc) by using crle.

    HTH



    --chargrill
    $,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}