Hi, all. I've got problems when I tried to compile a .c file which contains codes of calling perl functions. I made the code according to the perlembed documentation. The perl function can be called successfully from my another test.c file. Any suggestions will be appreciated. The command that I used for compiling is:
gcc -g -pedantic-errors -DBTDEBUG -I/usr/lib/perl5/5.8.0/i386-linux- +thread-multi/CORE -Wall -D__USE_FIXED_PROTOTYPES__ -I. -I.g -I/usr/ +X11R6/include `perl -MExtUtils::Embed -e ccopts` -DPERL_POLLUTE -o Li +nux_x86_glibc-2.3.2_gcc.debug/am_string.o -c am_string.c
The error messages I got are:
/usr/include/netdb.h:480: ISO C89 does not support `static' or type qu +alifiers in parameter array declarators In file included from am_string.c:16: /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/perl.h:3841:24: ISO +C does not permit named variadic macros am_string.c:816:54: ISO C99 requires rest arguments to be used am_string.c:861:42: ISO C99 requires rest arguments to be used am_string.c: In function `mk_string_from_line_without_quoted_newlines' +: am_string.c:924: ISO C89 forbids mixed declarations and code am_string.c:928: ISO C forbids braced-groups within expressions am_string.c:928: ISO C forbids braced-groups within expressions am_string.c:932: ISO C forbids braced-groups within expressions am_string.c:979:70: ISO C99 requires rest arguments to be used am_string.c:993:54: ISO C99 requires rest arguments to be used
Thanks!

update (broquaint) - added <code> tags


In reply to compiling problems of calling perl from C 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.