On Tue, 9 Mar 2004 17:26:11 -0800, [EMAIL PROTECTED] (Hariharan L Thantry) wrote:
>Kinda new to XS and interfacing Perl with Win32 C code. I looked at the >tutorial for perlXS and am trying to get the first serious code to work >on my Windows XP system. I began XS on Win32 only last month, so the XS tutorial is semi-fresh in my mind. >When trying to compile the example here >http://www.perldoc.com/perl5.8.0/pod/perlxstut.html#EXAMPLE-4 > >I always get the following error on my machine --snip-- Those non-fatal warnings are normal for this example. >And when running nmake, I get the following error, --snip-- >AutoSplitting blib\lib\Mytest2.pm (blib\lib\auto\Mytest2) > mylib/libmylib.lib: mylib/Makefile >'mylib' is not recognized as an internal or external command, >operable program or batch file. --snip-- At the bottom of Mytest2/Makefile.PL, you should have this subroutine: sub MY::postamble { ' $(MYEXTLIB): mylib/Makefile cd mylib && $(MAKE) $(PASSTHRU) '; } The only leading whitespace in that subroutine is a single tab before the 'cd'. When I add a few spaces before the '$(MYEXTLIB)' line, I get the same error that you did. For example: sub MY::postamble { ' $(MYEXTLIB): mylib/Makefile cd mylib && $(MAKE) $(PASSTHRU) '; } produces the error: 'mylib' is not recognized as an internal or external command, operable program or batch file. Therefore, I suspect that your problem is caused by whitespace before the '$(MYEXTLIB)'. Once you get past this error, there may be another Win32 problem lurking. When using the MS VC++ compiler on example 4, I got this error: LIB : fatal error LNK1104: cannot open file 'libmylib.lib' To fix the problem, I had to change the '(AR)' line in Mytest2/mylib/Makefile.PL, like so: - $(AR) cr libmylib$(LIB_EXT) $(O_FILES) + $(AR) -nologo -out:libmylib$(LIB_EXT) $(O_FILES) -- Hope this helps, Bruce Gray Util of Perlmonks.org