In the imortal words of the single greatest character in all media, in all history, Jar Jar Binks: My give up.

FFI::Platypus was sagely recommended here before. I read the doc and watched the youtube talks; read a few of the example scripts and tests. I am really excited to try it.

I cannot even get the most simplistic lib check—on the libraries I’m interested in using—to work. I have tried about 100 minor variations of this basic formula (including paths all over my drive and variations and guesses on lib names and adding recurse => 1) to no avail.

Standard library

perl -MFFI::CheckLib -E 'say "OK" if find_lib_or_exit lib => "archive" +' OK

DCMTK library

# Tried MANY variations on this theme with lib_path and recurse too. perl -MFFI::CheckLib -E 'find_lib_or_exit lib => "dcmdata"' library not found: dcmdata at -e line 1.

DCMTK is definitely installed on my system; as a binary, I think, I don’t remember building/installing it. I can find the libraries manually, I think. I tried using their various paths. The tools are in the regular $PATH, e.g. /usr/local/bin/dcmodify. The packages I am interested in wrapping up and using in Perl include those here DCMTK Documentation.

What am I doing wrong? Surely something, I hope something, simple.

Solved

The simple problem—finding the library—is solved with a local tweak thanks to swl pointing out the platform specific regex. They use the extension “a.”

find /usr/local/lib | ack dcmdata /usr/local/lib/libdcmdata.a
# Change in FFI::CheckLib. push @$pattern, qr{^lib(.*?)(?:\.([0-9]+(?:\.[0-9]+)*))?\.(?:dylib|b +undle|a)$}; # add "a"
perl -MFFI::CheckLib -E 'say "OK" if find_lib_or_exit lib => "dcmdata" +' OK

In reply to [Solved] FFI::Platypus; trouble finding non-standard, but present, libs by Your Mother

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.