Hi Roderich Thanks for replying.
Running pp -c --lib c:\strawberry\perl\vendor\lib -o invtot.exe invtot.pl produces the same list of 1358 files in the archive. Now the error message is somewhat different when I run the exe: Can't load 'C:\Windows\temp\par-rappazf\cache-56e9d7591c583b009e3620ebf2e703c37dcb76eb\406bec98.dll' for module Pango: load_file:The specified module could not be found at C:/strawberry/perl/lib/DynaLoader.pm line 200. at C:/strawberry/perl/site/lib/PAR/Heavy.pm line 120 Compilation failed in require at Gtk2.pm line 31. BEGIN failed--compilation aborted at Gtk2.pm line 31. Compilation failed in require at script/invtot.pl line 9. BEGIN failed--compilation aborted at script/invtot.pl line 9. I got the Gtk2 with http://code.google.com/p/gtk-perl-compiler/ which takes the glib stuff from http://ftp.gnome.org/pub/gnome/binaries/win32 Now looking at the bug you mentioned, shall I try the solution proposed there ?? (downgrade to Module::ScanDeps 0.73 using: cpan> install S/SM/SMUELLER/Module-ScanDeps-0.73.tar.gz and use pp -r -o gtk_test.exe gtk_test.pl ^ --lib c:\strawberry\perl\vendor\lib ^ -l c:\strawberry\perl\site\lib\auto\Cairo\Cairo.dll ^ -l c:\strawberry\perl\site\lib\auto\Glib\Glib.dll ^ -l c:\strawberry\perl\site\lib\auto\Pango\Pango.dll ^ -l c:\strawberry\perl\site\lib\auto\Gtk2\Gtk2.dll) Best François > -----Original Message----- > From: Roderich Schupp [mailto:roderich.sch...@googlemail.com] > Sent: lundi, 13. février 2012 13:29 > To: RAPPAZ Francois > Cc: par@perl.org > Subject: Re: packaging gtk2 script: use Gtk2 -init; failed > > On Fri, Feb 10, 2012 at 15:11, RAPPAZ Francois > <francois.rap...@unifr.ch> wrote: > > pp -l "C:\strawberry\perl\site\lib\auto\Cairo\Cairo.dll" -l > > "C:\strawberry\perl\site\lib\auto\Pango\Pango.dll" -l > > "C:\strawberry\perl\site\lib\auto\Glib\Glib.dll" -l > > "C:\strawberry\perl\site\lib\auto\Gtk2\Gtk2.dll" -o invtot.exe > > invtot.pl > > > > when I run the exe I got > > GLib-GObject-CRITICAL **: g_boxed_type_register_static: assertion > `g_type_from_name (name) == 0' failed at > C:/strawberry/perl/lib/DynaLoader.pm line 223. > > cannot register alias Gtk2::Pango::Attribute for the unregistered > type (null) at C:/strawberry/perl/lib/DynaLoader.pm line 223. > > Compilation failed in require at script/invtot.pl line 9. > > Known problem: [rt.cpan.org #55390] Cannot package with GTK on Windows > Note: ignore anything beyond the original bug report, because it fails > to address the real problem. > > AFAIK this is what happens: > > (1) The -l options for pp aren't necessary: the DLLs should already be > present in the packed executable. Please pack without -l and run "unzip > -l invtot.exe" to verify. > > (2) The real problem is that these "glue" DLLs reference each other. > This can't work, as PAR::Packer > extracts these DLLs using a mangled name. It overrides Dynaloader, so > that loading these DLLs *from perl* (e.g. "use Glib;" -> > Glib::bootstrap) works, but not on the Windows level. > I think that's the reason for error "Compilation failed in require at > Gtk2.pm line 31" in #55390. > > If you add the above -l options then your packed executable contains a > second copy of these DLLs in a directory that is extracted without > mangling. Now runtime loading succeeds, but apparently the Glib etc > initialization code isn't run (or is run in the other copy of the DLL? > is that even possible on Windows?). That results in "GLib-GObject- > CRITICAL **: > g_boxed_type_register_static: assertion > `g_type_from_name (name) == 0". > > BTW, where did you get the Gtk stuff from? > > Cheers, Roderich