I hope SCO has added the "ldd" command since the last time I worked with it (many years ago). Use that command on the shared library that Perl creates to see what other dynamic libraries it expects to load and where it expects to find them.

You can also check "man ld" and see if the environment variable LD_RUN_PATH is supported and have that set when you compile the module so that it contains a PATH-style list of directories to search for shared libraries when you run the module.

You can also set LD_LIBRARY_PATH (everybody supports that, right?) when you use the module to the same thing.

But I doubt it is actually a failure to find the shared library that is the problem. If it were, you should be getting a different error.

Did you make the function "universal" so that it can be seen from outside the shared library? Can you link non-Perl programs to that shared library and successfully call that routine?

You can also load shared libraries "by hand" inside the *.pm for your module. Or you can use FFI or C::Dynalib to access the shared library without building a module.

        - tye (but my friends call me "Tye")

In reply to (tye)Re: Accessing a C library from Perl by tye
in thread Accessing a C library from Perl by Anonymous Monk

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.