Getting Gtk3 to work with PAR

[email protected] (Zakariyya Mughal)
Newsgroups perl.par
Message-ID <20160613195406.GK22639@simulo>
Hello,

I am using MSYS2/MinGW64 to run a Gtk3 Perl application.

Has anyone been able to get PAR to work properly in this situation?

I notice that there is a similar issue
<https://rt.cpan.org/Public/Bug/Display.html?id=55390> that was opened
in 2010 for a Gtk2 program.

I translated the script that was attached to that issue to a Gtk3
equivalent (which I save as test.pl):

    use Gtk3 -init;

    my $window = Gtk3::Window->new ('toplevel');

    my $button = Gtk3::Button->new ('Quit');
    $button->signal_connect (clicked => sub { Gtk3->main_quit });
    $window->add ($button);

    $window->show_all;
    Gtk3->main;

When I run the following pp command, I get the test.exe as I expect:

    ALL_LIBS=$(pkg-config.exe  --libs gobject-introspection-1.0 expat cairo-gobject gtk+-3.0 | perl -MText::ParseWords -E 'my @paths = map { $libname = s/^-l//r; glob("C:/msys64/mingw64/bin/lib$libname*.dll") } grep { /^-l/ } shellwords(<>); print "-l $_ " for @paths')
    perl -Ilib $(which pp) -o test.exe test.pl $ALL_LIBS

But when I run the test.exe, I get the following output:

    $ ./test.exe
    Can't load 'C:\msys64\tmp\par-7a616b69\cache-b75d584224b1a1061779c0bb91d380c83ae4a68e\79d2d23b.dll' for module Cairo::GObject: load_file:The specified module could not be found at C:/msys64/mingw64/lib/perl5/core_perl/DynaLoader.pm line 193.
     at C:/msys64/mingw64/lib/perl5/site_perl/PAR/Heavy.pm line 120.
    Compilation failed in require at Gtk3.pm line 47.
    BEGIN failed--compilation aborted at Gtk3.pm line 47.
    Compilation failed in require at script/test.pl line 1.
    BEGIN failed--compilation aborted at script/test.pl line 1.

The same script can be compiled fine on a Debian GNU/Linux system.

Any tips for how I can get this working or how to debug the problem?

Cheers,
- Zaki Mughal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.