And I think what Rob mean is checking the difference of test.c and Mytest.c

I was actually thinking that there must be some difference between Mytest/test.h and the test.h that you provided in your first post. In Mytest.xs, could you try changing line 7 from #include  "test.h" to #include  "../test.h" and see if that makes any difference. Also, providing a copy'n'paste of the output when using the -E switch, as almut suggested, would perhaps help us work out what's going wrong.

should I report author of h2xs it?

No - I've just done exactly the same as you did (also using Strawberry Perl 5.10.1, as you did), and can't reproduce the problem. I ran:

h2xs -Afn Mytest
copy test.c Mytest
copy test.h Mytest
h2xs -Oxan Mytest test.h

Then, when I switch to the Mytest folder, I get:
C:\_32\pscrpt\Mytest>perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Mytest C:\_32\pscrpt\Mytest>dmake cp lib/Mytest.pm blib\lib\Mytest.pm C:\strawberry\perl\bin\perl.exe C:\strawberry\perl\lib\ExtUtils\xsubpp + -typemap C:\strawberry\perl\lib\ExtUtils\typemap Mytest.xs > Mytest.xsc && C: +\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "mv" -- Mytest.x +sc Mytest.c Please specify prototyping behavior for Mytest.xs (see perlxs manual) gcc -c -I. -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE - +DPERL_IMPL ICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_RE +ADFIX -s - O2 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-IC:\strawberr +y\perl\lib \CORE" Mytest.c Running Mkbootstrap for Mytest () C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 +Mytest.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Mytest\", 'DLBASE' => 'Mytest', 'DL_FUNC +S' => { } , 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" dlltool --def Mytest.def --output-exp dll.exp g++ -o blib\arch\auto\Mytest\Mytest.dll -Wl,--base-file -Wl,dll.base - +mdll -s -L "C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" Mytest.o -Wl,--i +mage-base, 0x3e0d0000 C:\strawberry\perl\lib\CORE\libperl510.a -lmoldname -lkern +el32 -luse r32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleau +t32 -lneta pi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 dll.e +xp dlltool --def Mytest.def --base-file dll.base --output-exp dll.exp g++ -o blib\arch\auto\Mytest\Mytest.dll -mdll -s -L"C:\strawberry\perl +\lib\CORE" -L"C:\strawberry\c\lib" Mytest.o -Wl,--image-base,0x3e0d0000 C:\stra +wberry\per l\lib\CORE\libperl510.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinsp +ool -lcomd lg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_3 +2 -lmpr -l winmm -lversion -lodbc32 -lodbccp32 dll.exp C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 +blib\arch\ auto\Mytest\Mytest.dll C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "cp" -- Mytest. +bs blib\ar ch\auto\Mytest\Mytest.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 +blib\arch\ auto\Mytest\Mytest.bs C:\_32\pscrpt\Mytest>
We first ought to find out why it's not working for you.

Cheers,
Rob

In reply to Re^5: 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.