http://www.perlmonks.org?node_id=603560


in reply to linking to .so file in non-standard location

Push the appropriate directory onto @DynaLoader::dl_library_path before using the module which loads the .so file. DynaLoader's documentation is a little unclear about this, but it's there if you know what to look for.

Replies are listed 'Best First'.
Re^2: linking to .so file in non-standard location
by mpeters (Chaplain) on Mar 07, 2007 at 19:39 UTC
    I tried this
    BEGIN { require DynaLoader; push(@DynaLoader::dl_library_path, '/custom/path'); require Business::OnlinePayment::PayflowPro; }
    Which seems like it ought to work, but doesn't. I still get the same failure: Can't load 'lib/i686-linux/auto/PFProAPI/PFProAPI.so' for module PFProAPI: libpfpro.so: cannot open shared object file: No such file or directory at /usr/local/lib/perl5/5.8.8/i686-linux/DynaLoader.pm line 230. I even verified that DynaLoader can load the libpfpro.so module on it's own by calling DynaLoader::dl_findfile('libpfpro.so'); which returns the correct path. Any further advice?

    -- More people are killed every year by pigs than by sharks, which shows you how good we are at evaluating risk. -- Bruce Schneier