I've tried it the way you did above:
int wrap_RegisterClient2(int cl_id, char* read_ip) { return RegisterClient2(cl_id, read_ip); }
but it doesn't work, I get the same error message as in the case without the wrapper.

The problem, I believe, is that unless all the parameters, and the return type, are types that the default typemap knows how to handle, Inline::C doesn't wrap and export it. And it appears that the default typemap doesn't know how to handle int *.

So, whilst this works fine:

#! perl -slw use strict; #use Inline C => Config => BUILD_NOISY => 1; use Inline C => <<'END_C', NAME => '_test', CLEAN_AFTER_BUILD => 0; int test( int i ) { return i; } END_C print test( 123 ); __END__ C:\test>test 123

This doesn't:

#! perl -slw use strict; #use Inline C => Config => BUILD_NOISY => 1; use Inline C => <<'END_C', NAME => '_test', CLEAN_AFTER_BUILD => 0; int test( int *i ) { return *i; } END_C print test( 123 ); __END__ C:\test>test Warning. No Inline C functions bound to Perl in C:\test\test.pl Check your C function definition(s) for Inline compatibility Use of inherited AUTOLOAD for non-method main::test() is deprecated at + C:\test\test.pl line 12. Can't locate auto/main/test.al in @INC (@INC contains: C:\test\_Inline +\lib C:/Perl64/site/lib C:/Perl64/lib .) at C:\test\test.pl line 12

There is the TYPEMAPS configuration option, but I haven't seen any (good) documentation on that. And finding the default typemap and looking at that doesn't yield many clues.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

In reply to Re^3: Calling a function form an external DLL with Inline::C on windows by BrowserUk
in thread Calling a function form an external DLL with Inline::C on windows 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.