Soumen Das <[EMAIL PROTECTED]> writes:
>Hi,
>
>I am wrapping a few C++ API's with perl xs on Solaris. The C++ API's
>dynamically load a few shared objects(these shared objects are not linked).
>With a small C++ test app and using the same C++ API's, this happens
>successfully. But when I do the same with the Perl wrapped API's it fails to
>dynamically load the shared object. Any reasons why this would happen only
>thru the Perl program which wraps the C++ API's ?
What does 'truss' show as happening ?
Guess:
With a stand alone C++ app. the loaded shared objects get to see the symbols
in the application - the executable. When you load shared objects
into a perl extension which is itself loaded the "exectuable" is perl itself,
so the second-level loadables see that and not the thing with the API.
There are various work rounds:
- link the perl extension with the libraries explicitly.
- re- dlopen() the externsion.so with RTLD_LOAD_GLOBAL to make its
symbols available to loadables.
- statically link the extension to a perl.
>
>I am sure about my LD_LIBRARY_PATH.
LD_LIBRARY_PATH is a bad idea in general.
>Also tried using the PERL5LIB
>environment variable.
>
>Regards,
>Soumen
--
Nick Ing-Simmons