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

So I am writing a Perl/Tk program, and packaging it up with just pp. This is the line I used:

pp -c -o script.exe script.pl

It packages up fine, but when I try to run it, I get this error message:

couldn't read bitmap file "": No such file or directoryerror reading b +itmap file "" at Tk/Widget.pm line 205. at Tk/Widget.pm line 203.

Sources online (including the CPAN PAR::FAQ page) say it's not picking up the image files for certain widgets (such as the Browse Entry) and I need to include certain .xbm files. I put all the .xbm files in an xbm folder (inside the directory where I ran the pp command). First I tried to include just the files indicated (arrowdownwin.xbm and cbxarrow.xbm), then I tried adding all of the .xbm files:

pp -c -a xbm/arrowdownwin.xbm -a xbm/cbxarrow.xbm -o script.exe script +.pl pp -c -a xbm -o script.exe script.pl

But in all cases, even after I manually add the .xbm files, I still get the same error. Heck, just for kicks and giggles, I added all the .xpm file to the xbm folder so they would be added too. I even added the .gif files too! Still no dice. I really am at a loss as to why this keeps happening.

PAR and PAR::Packer are up to date (1.007 and 1.014 respectively). So is Tk (804.031). Perl is v5.16.0, non-threaded. Dev OS is Linux, Red Hat Enterprise 5.6 and the target OS will be the same.

I also read that having unicode characters in the path would bork it up, but my paths are ascii-only characters. So I can't change that to fix the problem.

Update! Unfortunately I cannot include the actual program because of proprietary information, but I worked on a few simple examples that I could share. Unfortunately, they are too small, too simple, and most unfortunately, they work. I will continue to grow the sample's complexity until they reproduce the problem.

To give you an idea of what is going on, my beastly program includes several CPAN modules, many homemade modules, and a megawidget; it also makes system calls and calls other perl scripts. The Tk gui is in its own module, as is the logic that runs the gui.

Replies are listed 'Best First'.
Re: error reading bitmap file "" at Tk/Widget.pm line 205
by Anonymous Monk on Oct 10, 2013 at 18:29 UTC
    Adding the files to the archive with -a doesn't mean Tk knows to find them where you added them, or maybe even that PAR... unpacks them by default (it probably does, .... details)

    Post some code :) so I can run it down, or just use the -x option

      Isn't the -c similar, in that it looks for run-time dependencies?

        Isn't the -c similar, in that it looks for run-time dependencies?

        Similar isn't the same as same ... when you tried it, did it work?

Re: error reading bitmap file "" at Tk/Widget.pm line 205
by ric00015 (Beadle) on Oct 22, 2013 at 19:56 UTC

    Update! I finally figured out what was going on. I tried to replicate the error with some sample code, but unfortunately, the code worked. But in tinkering around with the program, I figured out the problem.

    I had the main.pl file, a gui.pm file and a core.pm file. The core.pm contained the logic, the gui.pm contained the Tk, and the main program had almost nothing in it. I had use Tk; in main.pl, because I started the MainLoop there, but apparently I needed use Tk::BrowseEntry; as well. I'm not sure why, but that solved my problem. My packaging command looked something like this:

    pp -c -a cbxarrow.xbm -a arrowdownwin.xbm -o main main.pl

    I am running into other problems now, but I'll do some more research, and if I can't find anything, I'll just make another thread. This thread has been solved.