Torsten Schoenfeld kirjoitti:
spicy jack wrote:I've been working on getting the Gtk2-Perl stack to compile under MSWin32 without as much pain as there is now. Windows has something called 'import libraries' [1], which currently I have to create by hand when I compile Cairo and Glib in order to get Gtk2 to compile. I create these import libraries by hacking up the Makefile and adding something similar to this:I don't have this problem on Windows XP with gtk+ 2.12.9, Visual Studio 6.0, perl 5.8.8 from ActiveState, and CVS checkouts of our modules. Glib, Gtk2, and Gtk2::GladeXML compile and pass all their tests. I'm not sure if it's still necessary, but at some point in the past, ExtUtils::MakeMaker had to be patched to not discard important linker arguments. See <http://rt.cpan.org/Ticket/Display.html?id=21430>. If you're using perl 5.10, you'll need to patch ExtUtils::Depends as in the attached patch. I'll commit it shortly.
The patch modifies the cygwin entry in the find_extra_libs. Spicy and me as well are using MinGW, which have MSWin32 in $^O, which makes find_extra_libs use ".lib", which is the extension MS compilers use AFAIK.
The GTK runtime has both ".dll.a" and ".lib" import libraries. Only the ".dll.a" ones have the "lib" prefix, which seems to be required by Kid.pm (assumably ActiveState's version is modified to not to). I'm used to patching Glib and Gtk2 Makefile.PL's so that they use the ".dll.a" import libraries (http://geoinformatics.tkk.fi/twiki/bin/view/Main/InstallingWithMinGW). Thus I also create import libraries with .dll.a extensions for Glib.dll etc (see the wiki page).
Because find_extra_libs does not find my Glib.dll.a I have to add them by hand to Makefile too (see the wiki page, it says "sometimes" though).
My approach works but all this feels as a mixture between MS compilers and cygwin, I'm not sure what should be fixed - at least I'd like to change Glib et al Makefile.PL's so that I didn't need to hand-edit Makefile.
Best regards, Ari -- Prof. Ari Jolma Geoinformatiikka / Geoinformatics Teknillinen Korkeakoulu / Helsinki University of Technology tel: +358 9 451 3886 address: POBox 1200, 02015 TKK, Finland Email: ari.jolma at tkk.fi URL: http://www.tkk.fi/~jolma