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

I have a piece of open-source software I wrote ( http://www.lightandmatter.com/ogr/ogr.html ) that is mainly meant to run on linux, but I was also able to make it run on Windows using pp. I tested some version of the software on some version of Windows, and it worked, so I put the .exe up on my web site. Recently a user contacted me to say that it wouldn't run for him on Windows. He said he was getting an error message about running out of memory, which doesn't make a lot of sense, because the program really isn't that big. I tested the current version of my code in Wine and it worked. I got access to a Windows machine to test it on, and sure enough, it doesn't work -- which could be due to either a change in the version of Windows or a change in my software. When I double-click on the .exe, first Windows pops up a dialog box asking if I want to run it with reduced privileges. Regardless of whether I say yes or no, all I see after that is a black DOS prompt window that quickly flashes on the screen, then goes away. The Perl/Tk gui never actually runs.

My gut reaction is to say, "Oh, well, I have zero Windows skills and no convenient Windows machine for testing and development, so I'll just stop offering a Windows executable." It's noncommercial software, and I don't feel any strong desire to put lots of work into maintaining Windows support. Before I do that, does anyone have any other suggestions? E.g., is there some known problem with pp on new versions of Windows?

The program depends on Perl/Tk, plus a few other libraries. By trial and error, I found that pp wasn't smart enough to include all the dependencies, so I had to tell it about some of them by hand. Here is the command line for pp that suffices to give me an executable that runs in Wine:

pp -M JSON::PP -M JSON::PP58 -M Tie::Hash::NamedCapture -M Tk::Bitmap +-o opengrade.exe opengrade.pl

Does it matter that my development machine is x64 and the target machines are 32-bit?

Thanks in advance!

-Ben

Replies are listed 'Best First'.
Re: Windows .exe produced by pp no longer runs?
by ikegami (Patriarch) on Jan 25, 2011 at 04:22 UTC

    Regardless of whether I say yes or no, all I see after that is a black DOS prompt window that quickly flashes on the screen, then goes away.

    You surely couldn't see an error message if one were to be displayed. Run it from the console to see if you get an error message.

    -M Tie::Hash::NamedCapture

    Tie::Hash::NamedCapture is a internal Perl module. Something's not right if you need to package it.

    Does it matter that my development machine is x64 and the target machines are 32-bit?

    Not if it's a 32-bit Perl.

Re: Windows .exe produced by pp no longer runs?
by Anonymous Monk on Jan 25, 2011 at 08:31 UTC
Re: Windows .exe produced by pp no longer runs?
by elef (Friar) on Jan 25, 2011 at 09:42 UTC
    Add a -x switch to your pp command.
    That tells pp to run the script and monitor what modules are loaded, and package all of them with the script. In my experience, that usually solves the problem, because it picks up some module pp didn't find by itself and that you didn't think of, either.
      That works for .pm files, but not for .dll files, for that you need alternative means
        Do we know that the issue is caused by a .dll? I'd think -x is always worth a try, and if it doesn't solve it, one can go on to try other things.
Re: Windows .exe produced by pp no longer runs?
by bcrowell2 (Friar) on Jan 25, 2011 at 03:57 UTC
    Hmm...possibly I was simply remembering wrong about my testing. This page http://par.perl.org/wiki/FAQ says that pp doesn't work cross-platform. Maybe all I did was test it in wine, and that has always worked, but it doesn't run on windows.