On Thu, May 24, 2007 at 10:45:40AM +1000, Sisyphus wrote: > > ----- Original Message ----- > From: "Sean McMahon" <[EMAIL PROTECTED]> > To: <inline@perl.org> > Sent: Thursday, May 24, 2007 8:55 AM > Subject: Can Inline link to static libraries > > > >One of the reasons I started using Inline was because the xs code someone > >gave me couldn't link to static libraries. Can Inline::C get around this. > >Can Inline::Java get around this if I need to use Java? > > Can't speak for Inline::Java, but I've never had any trouble with Inline::C > linking to static libraries (you'll find an example or two in 'perldoc > Inline::C-Cookbook). But then, nor have I ever had any trouble with XS code > linking to static libraries. (It's usually just a matter of setting the > MakeMaker configuration appropriately.)
I've had issues, on OpenBSD in particular. Since Perl must dynamically load the module, what [static] libraries you build with/into your XS module need to have been compiled with the -fPIC flag (or whatever the local variant is, if one exists; on some systems its the default these days). If the static library wasn't built in such a way, then the OP might just be out of options.