I repeated your steps
$ h2xs -Afn Mytest Defaulting to backwards compatibility with perl 5.10.1 If you intend this module to be compatible with earlier perl versions, + please specify a minimum perl version with the -b option. Writing Mytest/ppport.h Writing Mytest/lib/Mytest.pm Writing Mytest/Mytest.xs Writing Mytest/Makefile.PL Writing Mytest/README Writing Mytest/t/Mytest.t Writing Mytest/Changes Writing Mytest/MANIFEST $ copy test.c Mytest 1 file(s) copied. $ copy test.h Mytest 1 file(s) copied. $ h2xs -Oxan Mytest test.h Defaulting to backwards compatibility with perl 5.10.1 If you intend this module to be compatible with earlier perl versions, + please specify a minimum perl version with the -b option. Overwriting existing Mytest!!! Writing Mytest/ppport.h Scanning typemaps... Scanning c:\perl\5.10.1\lib/ExtUtils/typemap Scanning test.h for functions... Scanning test.h for typedefs... Writing Mytest/lib/Mytest.pm Writing Mytest/Mytest.xs Writing Mytest/fallback/const-c.inc Writing Mytest/fallback/const-xs.inc Writing Mytest/Makefile.PL Writing Mytest/README Writing Mytest/t/Mytest.t Writing Mytest/Changes Writing Mytest/MANIFEST $ cd Mytest $ perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Mytest $ dmake test cp lib/Mytest.pm blib\lib\Mytest.pm AutoSplitting blib\lib\Mytest.pm (blib\lib\auto\Mytest) C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\perl.exe C:\perl\5.10.1\li +b\ExtUtils\xsubpp -typemap C:\perl\5.10.1\lib\ExtUtils\typemap Myte +st.xs > Mytest.xsc && C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\per +l.exe -MExtUtils::Command -e "mv" -- Mytest.xsc Mytest.c Please specify prototyping behavior for Mytest.xs (see perlxs manual) 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:\perl\5.10.1\lib\MSWin32-x86-multi-thread\CORE" Mytest. +c 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:\perl\5.10.1\lib\MSWin32-x86-multi-thread\CORE" test.c Running Mkbootstrap for Mytest () C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\perl.exe -MExtUtils::Comma +nd -e "chmod" -- 644 Mytest.bs C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\perl.exe -MExtUtils::Mksym +lists \ -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:\perl\5.10.1\lib\MSWin32-x86-multi-thread\CORE" -L"C:\Mi +nGW\lib" Mytest.o test.o -Wl,--image-base,0x3e0d0000 C:\perl\5.10 +.1\lib\MSWin32-x86-multi-thread\CORE\libperl510.a -lmoldname -lkernel +32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole3 +2 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodb +c32 -lodbccp32 dll.exp dlltool --def Mytest.def --base-file dll.base --output-exp dll.exp g++ -o blib\arch\auto\Mytest\Mytest.dll -mdll -s -L"c:\perl\5.10.1\lib +\MSWin32-x86-multi-thread\CORE" -L"C:\MinGW\lib" Mytest.o tes +t.o -Wl,--image-base,0x3e0d0000 C:\perl\5.10.1\lib\MSWin32-x86-multi +-thread\CORE\libperl510.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwi +nspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 +-luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 dll.exp C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\perl.exe -MExtUtils::Comma +nd -e "chmod" -- 755 blib\arch\auto\Mytest\Mytest.dll C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\perl.exe -MExtUtils::Comma +nd -e "cp" -- Mytest.bs blib\arch\auto\Mytest\Mytest.bs C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\perl.exe -MExtUtils::Comma +nd -e "chmod" -- 644 blib\arch\auto\Mytest\Mytest.bs C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\perl.exe "-MExtUtils::Comm +and::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t t/Mytest.t .. ok All tests successful. Files=1, Tests=2, 0 wallclock secs ( 0.02 usr + 0.03 sys = 0.05 CPU +) Result: PASS
I think you should update your toolchain and your test files (which don't seem to match).
$ pmvers Devel::PPPort ExtUtils::Constant ExtUtils::MakeMaker ExtUtils +::ParseXS C::Scan Devel::PPPort: 3.19 ExtUtils::Constant: 0.22 ExtUtils::MakeMaker: 6.56 ExtUtils::ParseXS: 2.2205 C::Scan: 0.74
h2xs.PL

In reply to Re: How convert header file to XS by h2xs? by Anonymous Monk
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.