http://qs1969.pair.com?node_id=1166929

I'm on Windows 10 with a perl 5.24 install in C:/strawberry

I lost so many hours trying to understand why dmake always failed with undefined reference, that I thougt usefull to give a recipe to others when I finaly found a workaround. Here it goes:

Notes:

The command given above for perl Makefile.PL has been used for the gtk+-bundle_2.24.10

A newer version could contains new libraries and this would cause dmake to fail with filex.h not found

In that case, you have to add the path to the missing file with -Ic:/this/is/where/thatmissing/file/is in the INC arg given to Makefile.PL.

Perl modules already installed have this header file in

C:\strawberry\perl\site\lib\xxxx\Install

And external libraries to uninstalled perl modules have their header files somewhere in

C:\prog\gtk+\include C:\prog\Gtk+\include\xxx C:\prog\Gtk+\lib\xxx\include
So rerun
perl Makefile.PL INC="changed to include the new path" dmake

until dmake gives no error.

The version of the Gtk2 perl module tested here were 1.2498 and 1.2499. If you try to compile these with an earlier version for the binaries (2.20 instead of 2.24) you will get undefined reference errors with GLib.

Now if you change the path where your gtk+ libraries have been unzipped (or if you remove C:/prog/gtk+/bin from your PATH environment variable, your perl scripts using Gtk2 will crash.

To gain independance from C:/prog/gtk+/bin, you need to copy some dll from this folder to your perl tree directory. This small script does this (the dll list hold for gtk+-bundle_2.24.10):

use strict; use warnings; use File::Copy; my $from= "C:/prog/gtk+/bin/"; my %fm=('C:/strawberry/perl/site/lib/auto/Glib/' => [qw( libglib-2.0-0.dll intl.dll libgthread-2.0-0.dll libgobject-2.0-0.dll )], 'C:/strawberry/perl/site/lib/auto/Cairo/' => [ qw( libcairo-2.dll libexpat-1.dll freetype6.dll libpng14-14.dll libfontconfig-1.dll zlib1.dll )], 'C:/strawberry/perl/site/lib/auto/Pango/' => [qw( libgmodule-2.0-0.dll libpango-1.0-0.dll libpangocairo-1.0-0.dll libpangoft2-1.0-0.dll libpangowin32-1.0-0.dll )], 'C:/strawberry/perl/site/lib/auto/Gtk2/' => [ qw( libgtk-win32-2.0-0.dll libgio-2.0-0.dll libgdk_pixbuf-2.0-0.dll libatk-1.0-0.dll libgdk-win32-2.0-0.dll )]); foreach my $dest (keys %fm){ my $files = $fm{$dest}; foreach my $file (@$files){ print "will copy $from$file to $dest/$file\n"; copy("$from$file", "$dest/$file") or die("failed... : $!"); } }

HTH !

UPDATE:Some year later.

frazap