in reply to Re^2: XSLoader/DynaLoader Can't Locate Library
in thread XSLoader/DynaLoader Can't Locate Library

Thank you for replying, glad it gave you something to try. I am going through your OP to pick out any information that I might have missed the first time.

First thing that strikes me is that you moved the library. We know nothing about how you built the XS libararies, so did you literally move it or did you rebuild it in the new location? I suspect that there is an issue with the libaries you built thinking they are in the original location (just a stretch guess).

Second thing is that DynaLoader is for Perl modules, so I was confused that this was being used to create and export your XS libraries. After educating myself a bit on DynaLoader, I see that it says:

It must be stressed that the DynaLoader, by itself, is practically useless for accessing non-Perl libraries because it provides almost no Perl-to-C 'glue'. There is, for example, no mechanism for calling a C library function or supplying arguments. A C::DynaLib module is available from CPAN sites which performs that function for some common system types. And since the year 2000, there's also Inline::C, a module that allows you to write Perl subroutines in C. Also available from your local CPAN site..

My suggestion is to take DynaLoader out of this altogether. Seems like you don't need it at all. XS based modules should work as normal if you just did a use My::XS::Module. On CPAN, XS based modules are not distributed as pre-compiled blobs, they are compiled and installed when you "install" the module. So get back to the basics:

  1. make sure you've rebuilt your XS modules for the new location
  2. get it to work in a simple script without DynaLoader with, use My::XS::Module
  3. make sure the lib directory in /path/to/lib/My::XS::Module is in @INC

Then iterate on that until you get it to work, once that happens you can translate what you did in the simple program. I am getting the feeling that the root of the issue is that you may have literally mv'd the libraries to the new location rather than rebuilding them.