frazap has asked for the wisdom of the Perl Monks concerning the following question:
Some years ago I succeed in having Gtk2 script packed with PAR after including dll with --link option.
These were Glib.dll, Gtk2.dll, Cairo.dll, Pango.dll.
The trick that was working then was to include the above dll and to rename the the Glib, Gtk2, Pango folders in lib/auto to hide them from the search path.
The dll were then taken from the par archive at shlib\MSWin32-x86-multi-thread-64int\ folder and the exe works.
More details here https://www.mail-archive.com/par@perl.org/msg05033.htmlThe problem:
I did a new perl install (strawberry perl v. 5.24) when my OS was changed. I compile the Gtk2 from source.
I can't find these dll (Glib.dll, Gtk2.dll) in my new perl install, I have instead Glib.xs.dll, Gtk2.xs.dll etc. I did find the first group in my tmp folders under C:/Users... where par archives are extracted: I have copied these dll in c:/docs/perl_dll
I tried to pack the following scriptuse strict; use warnings; use Gtk2 '-init'; use Glib qw/TRUE FALSE/; my $window = Gtk2::Window->new; $window->signal_connect (destroy => sub { Gtk2->main_quit; }); $window->show_all(); Gtk2->main;
Using Shawn Laffan's pp_autolink.pl https://github.com/shawnlaffan/perl-pp-autolink or the -x option of pp without any dll included make an exe that crash
RunningCan't load 'C:\Users\rappazf\AppData\Local\Temp\par-...\778ce824.xs.dl +l' for module Pango: load_file:The specified module could not be found at + C:/strawberry/perl/lib/DynaLoader.pm line 193.
Adding the xs.dll with --link did change the errors, but the inclusion of the 4 xs.dll does not give a working exe.objdump -x 778ce824.xs.dll | grep "DLL Name" gives DLL Name: libcairo-2.dll DLL Name: libglib-2.0-0.dll DLL Name: libgobject-2.0-0.dll DLL Name: libpango-1.0-0.dll DLL Name: libpangocairo-1.0-0.dll DLL Name: msvcrt.dll DLL Name: Cairo.xs.dll DLL Name: Glib.xs.dll DLL Name: KERNEL32.dll DLL Name: perl524.dll
With these dll on the option for pp
Without hidding the lib/auto/Glib .../Gtk2 .../Pango I get the error-l 'C:/strawberry/perl/site/lib/auto/Cairo/Cairo.xs.dll' -l 'C:/strawberry/perl/site/lib/auto/Glib/Glib.xs.dll' -l 'C:/strawberry/perl/site/lib/auto/Gtk2/Gtk2.xs.dll' -l 'C:/strawberry/perl/site/lib/auto/Pango/Pango.xs.dll' -l 'C:\docs\perl_dll\Pango.dll' -l 'C:\docs\perl_dll\Glib.dll' -l 'C:\docs\perl_dll\Gtk2.dll' -l 'C:\docs\perl_dll\Cairo.dll'
Renaming these folder and adding the dll above still gives the error belowGLib-GObject-CRITICAL **: g_boxed_type_register_static: assertion `g_t +ype_from_name (name) == 0' failed at C:/strawberry/perl/lib/DynaLoade +r.pm line 210. cannot register alias Gtk2::Pango::Attribute for the unregistered type + (null) at C:/strawberry/perl/lib/DynaLoader.pm line 210. Compilation failed in require at script/simple.pl line 12. BEGIN failed--compilation aborted at script/simple.pl line 12.
Can't locate loadable object for module Glib in @INC (@INC contains: C +:\Users\rappazf\AppData\Local\Temp\par-72617070617a66\cache-6d3232558 +24cd4b77983f4c61ece5aa2d701ac21\inc\lib C:\Users\rappazf\AppData\Loca +l\Temp\par-72617070617a66\cache-6d323255824cd4b77983f4c61ece5aa2d701a +c21\inc CODE(0x31e7e8c) CODE(0x31e8084)) at C:/strawberry/perl/site/l +ib/PAR/Heavy.pm line 99. Compilation failed in require at Gtk2.pm line 30. That's were 'use Gib +;' is called in Gtk2.pm and adding the Glib.dll, Gtk2.dll from the pe +rl_dll folder does not change this.
Can someone explains the difference between Glib.dll and Glib.xs.dll ? How come the first group is missing from my perl tree and my scripts are still working ?
How can I packed this script ?
François
|
|---|