Thanks Rob,

Following your suggestions I found out that the problem was adding the 
suffix '.a' to the name of my library in the LIBS parameter. 
'perl Makefile.PL' reported that it couldn't find the library. The 
problem was simply solved by removing the suffix.

Regards,
Luis


On Sun, Sep 02, 2012 at 05:31:43PM +1000, Sisyphus wrote:
> 
> ----- Original Message ----- From: "Luis Mochan"
> <[email protected]>
> To: <[email protected]>
> Sent: Sunday, September 02, 2012 4:29 PM
> Subject: [Perldl] Inline::Pdlpp
> 
> 
> >I'm trying to learn to use Inline::C and Inline::Pdlpp. I'm confused
> >by the following error. I made a small program to use data from a pdl
> >within a C routine. If I include the following line in the program:
> >use Inline Pdlpp=>Config=>
> >        MYEXTLIB=>'/some/path/libsomelibrary.a';
> >the program runs as expected. But if I include instead the line
> >   use Inline Pdlpp=>Config=>
> >     LIBS=>'-L/some/path -lsomelibrary.a';
> >the program fails with a segmentation fault. I guess that the problem
> >is simply that I don't understand all the differences between MYEXTLIB and
> >LIBS. Can someone please explain?
> >Regards,
> >Luis
> 
> I don't know much about it - on Win32 I only ever use MYEXTLIB with
> Inline if I want to link to a shared library (dll). But that doesn't
> make much sense when one looks at the ExtUtils::Makemaker
> documentation:
> 
> MYEXTLIB
> If the extension links to a library that it builds set this to the
> name of the library (see SDBM_File)
> 
> If libsomelibrary.a is pre-existing (ie does not get built by the
> Inline::C compilation) and you need to link to it, then I would
> expect that the LIBS approach should work.
> 
> If, in your script, you do:
> 
> use Inline Pdlpp=>Config=>
>    CLEAN_AFTER_BUILD => 0,
>    FORCE_BUILD => 1,
>    BUILD_NOISY => 1,
>    MYEXTLIB=>'/some/path/libsomelibrary.a';
> 
> then you'll be able to:
> 
> 1) See the ouptut of the build process (which may contain some
> useful warnings);
> 2) Go into the build directory and view the generated Makefile, XS
> file and C file (which may help you determine the difference between
> the 2 approaches).
> 
> (I think the path provided to LIBS needs to be a fully qualified
> path, not a relative path. However, I gather you're already
> providing a fully qualified path - and I would expect a different
> error if you weren't.)
> 
> Cheers,
> Rob
> 

-- 

                                                                  o
W. Luis Mochán,                      | tel:(52)(777)329-1734     /<(*)
Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388     `>/   /\
Apdo. Postal 48-3, 62251             |                           (*)/\/  \
Cuernavaca, Morelos, México          | [email protected]   /\_/\__/

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org                 



_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to