Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

pp created .exe only works on original computer

by perlpantherninja (Initiate)
on Jul 12, 2011 at 02:31 UTC ( [id://913832]=perlquestion: print w/replies, xml ) Need Help??

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

Hi, I am using "pp -o example.exe example.pl" to create an executable. It works fine on the computer that it is made on, but not on others. I am using XP and Tk. Have any tips? Thanks for your replies. -x didn't work. I forgot to mention that I am using strawberry. Can perlapp work with strawberry? I am going to try -M next.

Replies are listed 'Best First'.
Re: pp created .exe only works on original computer
by Marshall (Canon) on Jul 12, 2011 at 05:19 UTC
    This is because some modules are used that do not exist on the other computer. They are not in your .exe, but when it is run, they are found on your computer.

    When using Tk, find and "use" all the widgets that your code uses. use Tk::Button, etc. You only need: use Tk; when running with Tk installed on your machine, because Perl finds the Button or Menu or whatever when your code needs it. If you put an explicit "use" statement, that will be a huge hint to pp that it needs to include that module in the final .exe.

    It is also possible to give pp a list of modules to force into the .exe, but I think that just putting a use statement in the code is easier than that. This is one area where the ActiveState PerlApp shines, they have special heuristics for big libraries like Tk and this extra futzing is not needed, but of course their app costs money.

    Oh make sure that you test and exercise every type of widget that your Tk app needs. That the module is not there is only found during run time - so this can be an iterative process.

Re: pp created .exe only works on original computer
by elef (Friar) on Jul 12, 2011 at 10:18 UTC
    I've found that adding a -x to the pp command (for 'execute') tends to fix this. With -x, the .pl is executed, pp monitors what modules are loaded and includes them in the exe. It's the easiest, fastest way to try and solve the problem. If some modules are still skipped, you can add them manually.
      Thanks. I was hoping this would work. I got the same result.
Re: pp created .exe only works on original computer
by Anonymous Monk on Jul 12, 2011 at 07:56 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://913832]
Approved by lidden
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-03-19 07:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found