title: Calling function in inlined C library
body: <p>I'm trying to make a simple wrapper around the <a href="https://github.com/jgm/CommonMark" rel="noreferrer">CommonMark</a> C library using <a href="https://metacpan.org/pod/Inline::C" rel="noreferrer">Inline::C</a>. I have installed <code>libcmark.so</code> in <code>/usr/local/lib/</code>.</p>
  
  <p>My current code looks like this:</p>
  
  <pre><code>package Text::CommonMark;
  
  use strict;
  use warnings;
  
  sub commonmarker {
      my $text = shift;
      return commonmark_to_html($text);
  }
  
  use Inline C =&gt; qq{
  
      char* commonmark_to_html(char* thetext) {
  
          char* result = cmark_markdown_to_html(thetext, strlen(thetext));
          return result;
      }
  } =&gt; LIBS =&gt; '-L/usr/local/lib/ -llibcmark.so';
  
  1;
  </code></pre>
  
  <p>When using <code>commonmarker</code> from a script I get:</p>
  
  <pre><code>perl: symbol lookup error: /home/erik/sublimeworks/dists/Text-CommonMark/_Inline/lib/auto/Text/CommonMark_33fb/CommonMark_33fb.so: undefined symbol: cmark_markdown_to_html
  </code></pre>
  
  <p>I assume that my call to <code>cmark_markdown_to_html</code> doesn't match its signature, but all signatures for <code>cmark_markdown_to_html</code> that I've <a href="https://github.com/jgm/CommonMark/blob/master/src/cmark.h#L30" rel="noreferrer">found</a> look like this:</p>
  
  <pre><code>char *cmark_markdown_to_html(const char *text, int len)
  </code></pre>
  
  <p>I haven't touched either C or Inline::C before so I'm probably missing something.</p>