The problem is that the extracted libraries will not be loaded by Linux
because the extraction directory isn't on the LD_LIBRARY_PATH when the
process is started. PerlApp will add the extraction directory, but at
that time it is already too late. You could try re-exec yourself in a
BEGIN block, but I'm not sure if this is sufficient to solve the
problem. Something like this:
BEGIN {
return if defined $ENV{MYAPP_RESTARTED};
$ENV{MYAPP_RESTARTED} = 1;
exec(PerlApp::exe(), @ARGV);
}
Please report back to the mailing list if you can get this to work!
Cheers,
-Jan
PS: If possible, please use plain text instead of HTML for mailing list
postings!
From: pdk-...@listserv.ActiveState.com
[mailto:pdk-...@listserv.ActiveState.com] On Behalf Of Joshua
McClintock
Sent: July 20, 2006 3:37 PM
To: p...@listserv.ActiveState.com
Subject: PerlApp - missing .so's when running executable
The module I'm trying to use (Net::SSH2) depends on SSH2.so which
PerlApp correctly bind's into the executable. SSH2.so however, depends
on libssh2.so and libcrypto.so.0.9.7. These 2 libraries are not
included in the binary. I tried using the -bind option like so: --bind
libssh2.so[file=/usr/local/lib/libssh2.so,extract] -bind
libcrypto.so.0.9.7[file=/usr/lib/ libcrypto.so.0.9.7,extract]
It does extract them (I strace'ed the process), but when you go to run
the binary, it complains that SSH2.so cannot load (probably because it
cannot find libssh2.so and libcrypto.so.0.9.7. Am I going about this
the wrong way?
Here is the error:
Can't load 'auto/Net/SSH2/SSH2.so' for module Net::SSH2:
auto/Net/SSH2/SSH2.so: cannot open shared object file: No such file or
directory at /PerlApp/DynaLoader.pm line 212.
at perlapp.pl line 1357
BEGIN failed--compilation aborted at gt line 30.
Here is an ldd of SSH2.so:
libssh2.so => /usr/local/lib/libssh2.so (0xb7fad000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7e70000)
libm.so.6 => /lib/tls/libm.so.6 (0xb7e4e000)
libcrypto.so.0.9.7 => /usr/lib/libcrypto.so.0.9.7 (0xb7d4f000)
libdl.so.2 => /lib/tls/libdl.so.2 (0xb7d4c000)
libz.so.1 => /usr/lib/libz.so.1 (0xb7d3a000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
Thank you for any ideas on what to try next,
Joshua McClintock