gwhite has asked for the wisdom of the Perl Monks concerning the following question:

I just don't get it, I am getting this nmake error, it is an application I wrote so no PPM option, Makefile.PL runs without any errors. It is just copying some files around and inserting configuration directory information into several .pl files. Makefile.PL, make etc. runs fine on Linux and Sun platforms.

C:\>nmake Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. mkdir `C:\: Invalid argument at C:/my_perl/perl/lib/ExtUtils/Command.p +m li ne 186 NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code + '0xff' Stop. C:\>

On the windows platform I really don't even know where to start looking. Any help in avoiding the problem would be appreciated. If possible I would avoid Windows, but it just isn't possible.

g_White

Replies are listed 'Best First'.
Re: nmake error
by gwhite (Friar) on Dec 28, 2004 at 01:59 UTC

    With help of others I have traced this back to this line of code where BLIB_BASE is set (I think), it is something a hired gun wrote for me some time back, again this code works on other platforms just not windows, I am not exactly sure what it is trying to accomplish, can anybody help me out?

    sub postamble { BLIB_BASE=`$(PERL) -MFile::Basename -e 'print dirname $$ARGV[0]' $(INS +T_BIN)` HS_BLIB=$(BLIB_BASE)/my_code MY_CODE_SHARED_BDIR=$(HS_BLIB)/shared [and several more similar lines using the HS_BLIB constant] etc...
    g_White

      ` (back tick) works the same in /bin/sh as it does in Perl (roughly). It doesn't do anything useful in Win32 default shells.

      He's trying to set $BLIB_BASE to be the basename of $INST_BIN. Since INST_BIN is a directory, you could likely just use BLIB_BASE=$(INST_BIN)/.. instead.

      Otherwise you could change sub postamble to look up the value of INST_BIN at the time the makefile is written and have the Perl code inside of sub postamble compute the basename of that and just output BLIB_BASE=$base instead of trying to get Perl to write a makefile that get a shell to run a command that runs perl that outputs a value to be stored in a variable of the makefile.

      - tye        

        After comparing what happens on the Unix box, he wants to create a directory off the directory just below INST_BIN, so if INST_BIN is blib/bin, he just wanted blib, I imagine he did it this way in case someone tried to override the install directories. Anyway, for now I hard coded it, and got my project delivered.

        I appreciate the community support!

        g_White
Re: nmake error
by BrowserUk (Patriarch) on Dec 28, 2004 at 00:34 UTC

    Have you tried issuing the command "mkdir c:\" from a command line?


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.

      yes, and when I put in mkdir c:\mytest it works fine, in the makefile (which results from Makefile.PL) I can't find any instance of c:\: which appears to be what it is choking on. For all of my input directories I did not specify a drive and I have tried slashes in both the windows direction "\" and in the Unix direction "/" with the same results.

      g_White

        The error message you posted certainly makes it look like your trying to execute the command mkdir c:\ which will fail.

        Try adding the /N switch to the nmake command so that you can see what commands are being issued.

        You might also try /I and see if it would build if you ignore the error(s). It doesn't fix things, but at least you would know whether it is just cmd.exe being more pendantic than other shells or something more serious.


        Examine what is said, not who speaks.
        Silence betokens consent.
        Love the truth but pardon error.

        I noticed "C:\>nmake" at the top of your example. It looks as though you're trying to build something in "C:\". This is a bad idea for a variety of reasons, the least of which being that "C:\" usually contains everything on your hard disc, and as result, Makefile.PL will probably end up checking lots and lots of stuff to make sure the MANIFEST file is correct, as you may or may not have noticed.

        My advice would be to move Makefile.PL and everything else to that /mytest directory you just created and try building there instead.

Re: nmake error
by erix (Prior) on Dec 28, 2004 at 01:38 UTC

    Have you tried the mkdir with double backslashes? (And if that doesn't work, single forward slash might work.)

    mkdir c:\\mytest

      It's not a manual command, this is a result of running nmake. All of those system specific items are supposed to get handled. In theory, you write a Makefile.PL file that should build a makefile which nmake, dmake, make, or gmake (and others) should then interpret properly to get what you wanted done.

      g_White