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

Hey guys, I am rather new to Perl and am by no means an expert. I have recently written a simple .pl and have been trying to compile it to a .exe. I have downloaded Wx::Perl::Packager, and placed the corresponding headers at the top of the program beneath #!/usr/perl/bin. The PerlApp always reaches an error and cannot locate a file when it attempts to compile with the Wx headers:

#!/usr/bin/perl use Wx::Perl::Packager; use Wx;

It said cannot locate Wx.pm @ (path). I corrected that by pointing the directory to a different location. Should work now right?

Wrong, it cant find ANOTHER file. This is a chain of events that has been occuring. I am sure I am doing something fairly obvious wrong, but cannot spot it. Please, could someone tell me what is wrong or perhaps lead me through the steps required to convert a .pl to a .exe using PerlApp? Keep in mind, I am a beginner. Thank you very much.

Replies are listed 'Best First'.
Re: Compiling Problems with PerlApp! Please Help.
by locked_user sundialsvc4 (Abbot) on Oct 15, 2010 at 16:56 UTC

    Perl looks for libraries in a series of locations, as described e.g. in perldoc perlrun.

    Most commonly, this environment variable is set up in a user-specific or system-wide .profile file, or a Windows setting.   It can also be specified by use lib

    Strictly speaking, Perl builds entries in an array named @INC, and it cycles through that array from beginning to end.   (The various methods I described are simply standard ways to populate that list.   The initial default entries in the list are hard-coded when the perl.exe executable is compiled.)

    I’m afraid that I can make no useful comment concerning PerlApp...   I have not yet used that utility.   I don’t know how it assimilates the modules into the program that it produces, nor what runtime characteristics that (generated) program might subsequently have.

Re: Compiling Problems with PerlApp! Please Help.
by Marshall (Canon) on Oct 15, 2010 at 18:42 UTC
    First "I have downloaded Wx::Perl::Packager" sounds a bit fishy. Both Wx and Wx::Perl::Packager are available in the main Active State repository. You should use ppm to install Active State packages - just "downloading" won't get the job done. Just type "ppm" on a command line and a GUI window will start - use that to install packages.

    I haven't used Wx before. I am not sure that you need this extra Packager if you are going to build a standalone .exe file. The current version of PerlApp is pretty smart about finding dependencies and getting them into the .exe. They have written some extra code with some heuristics for some of the major libraries, like Tk and hopefully Wx also.

    What happened when you tried to make a standalone .exe without this extra packager?

    Of course please confirm that you have an application that is working just fine with Wx before you tried to add this extra package manager?

    Update: Making a .exe file with a graphical UI is definitely not a "simple.pl" job! This can get pretty hairy! PerlApp has gotten a heck of a lot smarter since the first time that I used it. But this can still be a "non-trivial" exercise. Are you able to make a .exe from some non-graphical UI program with PerlApp? It just seems to me that you are trying to make a very big leap in one step.

      Well, I can compile the .exe for my own machine. However, when another person downloads it, they get an error that they are missing a .dll. What should i type on the command line under PPM?

      The main problem is that after the Wx headers are applied (see first post) the compiler gives me that list of unfound files. It will compile fine without the header, but the product will not work on other machines

      I thank you for your help so far, I think I just have a little ways to go... I hope. By the way, this is a standalone .exe

        Sorry, that was me above i forgot to log in.

Re: Compiling Problems with PerlApp! Please Help.
by emav (Pilgrim) on Oct 15, 2010 at 18:38 UTC

    As far as I know, in order for PerlApp to work smoothly you need to have ActivePerl installed in your system and use its repositories to install extra modules.

    Assuming you're OK with the above, I suppose it should all work out for you if you create a file argfile.args containing the following lines (which are good for ActivePerl 5.10):

    --bind mingwm10.dll[file=C:/Perl/site/lib/Alien/wxWidgets/msw_2_8_9_un +i_mslu_gcc_3_4/lib/mingwm10.dll,extract,mode=444] --bind wxbase28u_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWidgets/ +msw_2_8_9_uni_mslu_gcc_3_4/lib/wxbase28u_gcc_wxperl.dll,extract,mode= +444] --bind wxbase28u_net_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWidg +ets/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxbase28u_net_gcc_wxperl.dll,extra +ct,mode=444] --bind wxbase28u_xml_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWidg +ets/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxbase28u_xml_gcc_wxperl.dll,extra +ct,mode=444] --bind wxmsw28u_adv_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWidge +ts/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxmsw28u_adv_gcc_wxperl.dll,extract +,mode=444] --bind wxmsw28u_aui_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWidge +ts/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxmsw28u_aui_gcc_wxperl.dll,extract +,mode=444] --bind wxmsw28u_core_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWidg +ets/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxmsw28u_core_gcc_wxperl.dll,extra +ct,mode=444] --bind wxmsw28u_gl_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWidget +s/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxmsw28u_gl_gcc_wxperl.dll,extract,m +ode=444] --bind wxmsw28u_html_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWidg +ets/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxmsw28u_html_gcc_wxperl.dll,extra +ct,mode=444] --bind wxmsw28u_media_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWid +gets/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxmsw28u_media_gcc_wxperl.dll,ext +ract,mode=444] --bind wxmsw28u_qa_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWidget +s/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxmsw28u_qa_gcc_wxperl.dll,extract,m +ode=444] --bind wxmsw28u_richtext_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wx +Widgets/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxmsw28u_richtext_gcc_wxperl.d +ll,extract,mode=444] --bind wxmsw28u_stc_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWidge +ts/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxmsw28u_stc_gcc_wxperl.dll,extract +,mode=444] --bind wxmsw28u_xrc_gcc_wxperl.dll[file=C:/Perl/site/lib/Alien/wxWidge +ts/msw_2_8_9_uni_mslu_gcc_3_4/lib/wxmsw28u_xrc_gcc_wxperl.dll,extract +,mode=444] --bind gdilib/gdiplus.dll[file=C:/Perl/site/lib/Alien/wxWidgets/msw_2_ +8_9_uni_mslu_gcc_3_4/os/gdiplus.dl_,mode=444]

    Argfile.args should be placed in the same folder with the .pl file you have been trying to compile.

      what modules do I install???

        My wxPerl scripts compile fine once I install Alien-wxWidgets, Wx, and Wx-Perl-Packager. Of course, you will have to install any other modules you happen to use in your script to avoid compilation errors.