I am trying to call a function from a C library from my Perl code on SCO Unix machine. I have been able to successfully call a stub function in a small library I created to link in with my Perl code. The problem occurs when I try access the real library from the stub code. I get a run time error that looks something like: "Dynamic Linker:Perl:Symbol not found:myfunctionname". I have been able to call functions from a different library written by others but I have not been able to find a difference between the implementations of the two libraries. I believe the problem may be related to the system not being able to find my library, but I'm not sure where the system is looking. Honestly, I believe the problem most likely lies outside my Perl code, but I was hoping someone with unix experience might give me an idea of what it takes to dynamically link with a C library from Perl on a unix machine. What I really need to know is: what do I need to do differently in my code, Makefile and environment, to allow me to link with a C library at run time and call a function from it. I think I have it 90% figured out but I'm missing something.....

In reply to 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.