Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
"be consistent"

Re^3: RFC: Setting up a minGW compiling envronment for Perl 5.10

by Bloodrage (Monk)
on Mar 04, 2008 at 22:51 UTC ( #672022=note: print w/ replies, xml ) Need Help??

in reply to Re^2: RFC: Setting up a minGW compiling envronment for Perl 5.10
in thread RFC: Setting up a minGW compiling envronment for Perl 5.10

oooh, um what about I:\GTK\lib\libglib-2.0.dll.a and I:\GTK\lib\libcairo-2.0.dll.a? Are these the libraries we're looking for?

Can't check it here, this PC lacking in CPU... and I'd have to completely rebuild my Makefile.

Comment on Re^3: RFC: Setting up a minGW compiling envronment for Perl 5.10
Select or Download Code
Re^4: RFC: Setting up a minGW compiling envronment for Perl 5.10
by syphilis (Canon) on Mar 04, 2008 at 23:59 UTC
    Are these the libraries we're looking for?

    Unfortunately no. They are just the import libs. Instead of renaming the .lib files to .a files, you could have renamed the .dll.a files to .a files. That's what I did to get Glib and Cairo to build (and they built straight out of the box for me with 'perl', 'dmake test', and 'dmake install'). Had I have known that those .dll.a files were there I would have suggested you rename them instead of the .lib files - but it shouldn't matter anyway.

    Gtk2 is doing something that I've not come across before - and I hope I never come across it again. Some of its XSubs use XSubs that are part of the Glib and Cairo modules - and the only way to resolve the definition of those functions (that I can see) is to link to auto/Glib/Glib.dll and auto/Cairo/Cairo.dll.

    Maybe we have to go the -LC:/perl/site/lib/auto/Glib -lGlib, but I've gotta check that the -lGlib is, in fact, capable of linking to Glib.dll. (I think it should be, but I've gotta check on it - maybe you could give it a try, anyway.)

    I've also yet to see if Mr.Google can shed some light on how to fix this problem. And there's probably a gtk/glib mailing list if all else fails.

      Here's how I finally got Gtk2-1.164 to build:

      1) During the building of the Glib module, a file named Glib.def is created. Using Visual Studio's lib utility create, from Glib.def, an import lib named Glib.a as follows:
      lib /OUT:Glib.a /DEF:Glib.def
      With MinGW, the same can be achieved with:
      dlltool --input-def Glib.def --output-lib Glib.a
      Update: I made a mistake here. The command needs to be:
      dlltool --input-def Glib.def --output-lib Glib.a --dllname Glib.dll
      2) Repeat step 1 for the Cairo module.

      3) Copy Glib.a to
      and copy Cairo.a to
      (I'm assuming a Strawberry Perl directory structure - modify accordingly.)

      4) In the top level Gtk2 source folder run perl Makefile.PL

      5) Open the generated Makefile and, to the EXTRALIBS and LDLOADLIBS entries (in the MakeMaker const_loadlibs section), append:
      C:\strawberry\perl\site\lib\auto\Glib\Glib.a C:\strawberry\perl\site\ +lib\auto\Cairo\Cairo.a
      6)Run dmake test. Gtk2 should compile, though some of the tests fail (including some segfaults).Here is the test summary that I got:
      Failed Test Stat Wstat Total Fail List of Failed ---------------------------------------------------------------------- +--------- t/Gdk.t 4 1024 17 12 12-17 t/GdkDisplay.t 255 65280 24 47 1-24 t/GdkPixbuf.t 2 512 101 2 93 96 t/GdkProperty.t 255 65280 46 70 12-46 t/GdkSelection.t 255 65280 20 0 ?? t/GdkVisual.t 255 65280 24 32 9-24 t/GdkWindow.t 2 512 40 2 7-8 t/GtkFontSelection.t 1 256 9 1 8 t/GtkIconTheme.t 1 256 16 1 4 t/GtkIconView.t 5 1280 61 12 56-61 t/GtkImage.t 2 512 45 2 24 34 t/GtkScaleButton.t 5 1280 5 8 2-5 t/GtkStatusIcon.t 1 256 22 1 6 t/GtkTextView.t 1 256 45 1 44 t/GtkTreeSelection.t 255 65280 29 50 4-29 t/GtkTreeView.t 1 256 160 1 156 t/PangoCairo.t 255 65280 22 38 3-22 3 tests and 106 subtests skipped. Failed 17/206 test scripts. 148/4309 subtests failed. Files=206, Tests=4309, 86 wallclock secs ( 0.00 cusr + 0.00 csys = 0 +.00 CPU) Failed 17/206 test programs. 148/4309 subtests failed.
      Step 3 is probably unnecessary - in which case one, obviously, has to change the string that's appended to EXTRALIBS and LDLOADLIBS in the Makefile in step 5.

      There are probably other ways to get the job done - perhaps some of those ways are better than the method I used. This was just the first way I found of getting the job done.


        looks promising... I've done these things and all the other fixes that I've mentioned earlier (i.e. locating missing include directories and explicitly giving paths to library files) and Gtk2 compiles!

        Unfortunatly dmake test has issues. back to the toplevel.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://672022]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-04-18 06:40 GMT
Find Nodes?
    Voting Booth?

    April first is:

    Results (462 votes), past polls