In the Mytest directory can you successfully run:
gcc -c -I. -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE - +DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPER +L_MSVCRT_READFIX -s -O2 -DVERSION=\"0.01\" -DXS_VERSION=\"0 +.01\" "-IC:\strawberry\perl\lib\CORE" test.c
It runs fine for me (based on the test.h and test.c that you provided). If it doesn't work for you, then I suggest that the actual 'test.h' you're using is different to the one you provided in your original post. If, however, it does run fine for you, then try running:
gcc -c -I. -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE - +DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPER +L_MSVCRT_READFIX -s -O2 -DVERSION=\"0.01\" -DXS_VERSION=\"0 +.01\" "-IC:\strawberry\perl\lib\CORE" Mytest.c
That's the same as the first command I provided - except that 'test.c' has been replaced by 'Mytest.c'. That's also now the same command that failed for you in your original post - so it should fail again this time in exactly the same way. Does it ?

The point I'm trying to make is that something here just doesn't add up :-)

Cheers,
Rob

In reply to Re: How convert header file to XS by h2xs? by syphilis
in thread How convert header file to XS by h2xs? by xiaoyafeng

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.