More Info:
I reinstalled version-0.74 and Parse-RecDescent-v1.95.1, both of whom are prerequesistes to installing Inline::C. The make test ended with "Failed 5/6 test scripts, 16.67% okay. 8/11 subtests failed, 27.27% okay." as it had before.
When I tried running the original program I get the same result.So I tried the following minimalist program:
my $kk = kk(); print "perl kk=$kk\n"; use Inline C => <<'END_OF_C_CODE'; #include <stdio.h> #include <stdlib.h> #include <string.h> int kk () { printf("Hello!\n"); return(0); } END_OF_C_CODE
And I got the following output:
Hello! perl kk=0
So I can compile something, I then kept adding the lines I needed one at a time until I got to this:
my $kk = kk(); print "perl kk=$kk\n"; use Inline C => Config => LIBS => '-L/HASP/perltestP -llibhasp_linux.a +'; use Inline C => <<'END_OF_C_CODE'; #include <stdio.h> #include <stdlib.h> #include <string.h> #include <hasp_hl.h> #include <hasp_vcode.h> int kk () { hasp_status_t status; hasp_handle_t handle; int i; char filename[] = "prg"; printf("Hello!\n"); status = hasp_login(HASP_PROGNUM_DEFAULT_FID, (hasp_vendor_code_t *)vendor_code, &handle); // switch (status) { // case HASP_STATUS_OK: // printf("OK\n"); // hasp_logout(handle); // return(1); // break; // default: // printf("BAD\n"); return(0); } END_OF_C_CODE
Which broke complaining that :perl: symbol lookup error: /HASP/perltestP/_Inline/lib/auto/c2_pl_4339/c2_pl_4339.so: undefined symbol: hasp_login".
 
However, if I approach this from the C side as follows, it recolves hasp_login without a problem.
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <hasp_hl.h> #include <hasp_vcode.h> int kk () { hasp_status_t status; hasp_handle_t handle; int i; printf("start : "); status = hasp_login(HASP_PROGNUM_DEFAULT_FID, (hasp_vendor_code_t *)vendor_code, &handle); switch (status) { case HASP_STATUS_OK: printf("OK\n"); hasp_logout(handle); return(1); break; default: printf("BAD\n"); return(0); } } int main(void) { int result; result = kk(); printf("result was %d\n",result); }
This would indicate that Inline::C is unable to resolve extenal references that are not from itself ??? I think it all relates the the tests that are being failed on the "make test" of the Inlince::C installation. I've googled and I have checked the bug reports in cpan.org. Nothing really looks like this. Should I report it as a bug to "INGY" on cpan.org's site?

In reply to Re^6: Inline::C produces compilation errors by holandes777
in thread Inline::C produces compilation errors by holandes777

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.