Re: MinGW Build

On Wednesday 30 November 2005 01:42 pm, muppet wrote:
Win32 does not allow unresolved symbols at link time.  The symbols
you need are exported by the Glib.dll built by the Glib perl module;
you need to find that dll and add it to the link command.  This is
done for you with the MSVC toolchain by extra code in Gtk2/
Makefile.PL.  Poke around in that and you should find the necessary
pieces.  Please post your solution, preferably as a patch, and we'll
see about keeping this solved for future MinGW adventurers.

Here's some of the problems I've encountered so far on MinGW, and some 

Running the Makefile.PL gives the following error:

Can't load 'e:/perl-5.8.7/site/lib/auto/Glib/Glib.dll' for module Glib: 
load_file:Attempt to access invalid address at 
e:/perl-5.8.7/lib/ line 230.

The Glib module passed its tests, and 'perl -MGlib -e ""' works, so I don't 
think the Glib module is the problem.  The issue seems to be this line (which 
is inside a string eval):

"use Glib '$build_reqs{'perl-Glib'}';"

Putting a "use Glib;" at the top of the module makes the problem go away.

The straight 'make' program has not worked for me when building Perl itself or 
any modules.  The 'dmake' program must be used instead.  However, with the 
straight Makefile, dmake gives the following error:

dmake:  makefile:  line 19:  Error: -- Input line too long, increase 

According to the dmake man page, MAXLINELENGTH is a macro which sets the 
buffer dmake uses to hold the makefile.  The default setting can be viewed 
with 'dmake -V', which on my system is 8190.  It seems that this must be 
enough space, in bytes, to hold the entire makefile, which is 156 KB.  I 
rounded this up to the nearest factor of 2, which is 2**18, and then added 
the below to the top of the makefile:


After which the makefile runs fine until the linking stage, which I posted 
about before.

After running the make process once to get to the linking step, I then did 
'dmake > build.log', which puts in only the 'dlltool' command used to build 
the .exp module for building the dll, and then the linking command.  I then 
saved these commands into 'build.bat', which allows me to alter and run the 
link command just as the makefile would, but without having to crawl around 
inside a big ugly makefile.

First thing it obviously needed was the libraries, which are (taken from 
'pkg-config --libs gtk+-2.0'):

-lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 
-lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 
-lglib-2.0 -lintl -liconv -lperl58

This gets rid of most (but not quite all) the linking errors.  The options 
MUST go after the files being linked, or else they seem to be ignored (I've 
noted this behavior while building SDL_perl, too).

As noted in the reply above, the Glib.dll module built for the Glib Perl 
module must be added to the link command.  Putting in 
"E:/perl-5.8.7/site/lib/auto/Glib/Glib.dll" after the linked files (but 
before the library options noted above) fixes all errors.  I then ran 'dmake' 
again to finish off the make process.

Next comes 'dmake test'.  This fails with a popup that says "This application 
has failed to start because dll.exp.dll was not found. Re-installing the 
application may fix this problem."  I'm not sure where this dll.exp.dll is 
supposed to come from.  Google seems silent on the matter.

Attachment: pgpLqQ8FkzjEG.pgp
Description: PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]