Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: XSLoader/DynaLoader Can't Locate Library

by perlfan (Vicar)
on Jun 13, 2020 at 17:51 UTC ( [id://11118025]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11118025]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found