Re: MinGW Build




Timm Murray said:
On Thursday 01 December 2005 11:50 am, muppet wrote:
Timm Murray said:
On Wednesday 30 November 2005 01:42 pm, muppet wrote:
----
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/DynaLoader.pm 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.

To what does that string evaluate?  It should be something simple like "use
Glib '1.100';" (or whatever the actual required version is)...  is it
turning up empty?

Yes, putting in a warn() shows it as "use Glib '1.100';".


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
MAXLINELENGTH

Undoubtedly this is the line that looks like

  perl -MFoo bar '[ qq[File1.o] qq[File2.o] qq[File3.o] ... ]'

Actually, it's a very simple line:

#        NAME => q[Gtk2]


In the past a workaround for this has been to hand-edit the makefile to use
a more compact syntax, e.g.

  perl -MFoo bar '[qw(File1.o File2.o File3.o ... )]'

as this command runs up against command line length limits for cmd.exe or
command.com or whatever it is.  This solution doesn't scale, and your
MAXLINELENGTH is better for your situation, but i don't know what else to
do for the normal NMake situation.

I don't think it has anything to do with the shell (cmd.exe, btw), but is
specific to dmake itself.


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).

This is a known thing about how linkers work, not specific to GCC.  The
actual reason is complicated and specific to implementations, and any
attempt at explanation is bound to be incomplete, inaccurate, and
misleading.  The working understanding of "the thing that provides a symbol
must occur after the thing that uses the symbol" has served me without
fail.

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.

A safer bet for that would be after all of the *.o files and before all of
the -l options.

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.

That sounds suspiciously like a bad filename.  Are all the command-line
options sane?

There's nothing that sticks out to me in the build command:

----
dlltool --def Gtk2.def --output-exp dll.exp
g++ -o blib\arch\auto\Gtk2\Gtk2.dll -Wl,--base-file -Wl,dll.base -mdll -s
-L"e:\perl-5.8.7\lib\CORE" -L"e:\msys\1.0\mingw\lib" xs/Gdk.o xs/GdkColor.o
xs/GdkCursor.o xs/GdkDnd.o xs/GdkDrawable.o xs/GdkEvent.o xs/GdkGC.o
xs/GdkInput.o xs/GdkKeys.o xs/GdkPixbuf.o xs/GdkPixbufLoader.o xs/GdkPixmap.o
xs/GdkProperty.o xs/GdkRegion.o xs/GdkRgb.o xs/GdkSelection.o xs/GdkTypes.o
xs/GdkVisual.o xs/GdkWindow.o xs/Gtk2.o xs/GtkAccelGroup.o xs/GtkAccelLabel.o
xs/GtkAccelMap.o xs/GtkAdjustment.o xs/GtkAlignment.o xs/GtkArrow.o
xs/GtkAspectFrame.o xs/GtkBin.o xs/GtkBox.o xs/GtkButton.o xs/GtkButtonBox.o
xs/GtkCalendar.o xs/GtkCellEditable.o xs/GtkCellRenderer.o
xs/GtkCellRendererPixbuf.o xs/GtkCellRendererText.o
xs/GtkCellRendererToggle.o xs/GtkCheckButton.o xs/GtkCheckMenuItem.o
xs/GtkColorSelection.o xs/GtkColorSelectionDialog.o xs/GtkCombo.o
xs/GtkContainer.o xs/GtkCurve.o xs/GtkDialog.o xs/GtkDnd.o
xs/GtkDrawingArea.o xs/GtkEditable.o xs/GtkEntry.o xs/GtkEventBox.o
xs/GtkFileSelection.o xs/GtkFixed.o xs/GtkFontSelection.o xs/GtkFrame.o
xs/GtkGC.o xs/GtkGammaCurve.o xs/GtkHBox.o xs/GtkHButtonBox.o xs/GtkHPaned.o
xs/GtkHRuler.o xs/GtkHScale.o xs/GtkHScrollbar.o xs/GtkHSeparator.o
xs/GtkHandleBox.o xs/GtkIconFactory.o xs/GtkImage.o xs/GtkImageMenuItem.o
xs/GtkInputDialog.o xs/GtkInvisible.o xs/GtkItem.o xs/GtkItemFactory.o
xs/GtkLabel.o xs/GtkLayout.o xs/GtkList.o xs/GtkListItem.o xs/GtkListStore.o
xs/GtkMenu.o xs/GtkMenuBar.o xs/GtkMenuItem.o xs/GtkMenuShell.o
xs/GtkMessageDialog.o xs/GtkMisc.o xs/GtkNotebook.o xs/GtkObject.o
xs/GtkOptionMenu.o xs/GtkPaned.o xs/GtkPlug.o xs/GtkProgressBar.o
xs/GtkRadioButton.o xs/GtkRadioMenuItem.o xs/GtkRange.o xs/GtkRc.o
xs/GtkRuler.o xs/GtkScale.o xs/GtkScrolledWindow.o xs/GtkSelection.o
xs/GtkSeparatorMenuItem.o xs/GtkSizeGroup.o xs/GtkSocket.o xs/GtkSpinButton.o
xs/GtkStatusbar.o xs/GtkStock.o xs/GtkStyle.o xs/GtkTable.o
xs/GtkTearoffMenuItem.o xs/GtkTextChildAnchor.o xs/GtkTextBuffer.o
xs/GtkTextIter.o xs/GtkTextMark.o xs/GtkTextTag.o xs/GtkTextTagTable.o
xs/GtkTextView.o xs/GtkToggleButton.o xs/GtkToolbar.o xs/GtkTooltips.o
xs/GtkTreeDnd.o xs/GtkTreeModel.o xs/GtkTreeModelSort.o xs/GtkTreeSelection.o
xs/GtkTreeSortable.o xs/GtkTreeStore.o xs/GtkTreeView.o
xs/GtkTreeViewColumn.o xs/GtkVBox.o xs/GtkVButtonBox.o xs/GtkVPaned.o
xs/GtkVRuler.o xs/GtkVScale.o xs/GtkVScrollbar.o xs/GtkVSeparator.o
xs/GtkViewport.o xs/GtkWidget.o xs/GtkWindow.o xs/PangoAttributes.o
xs/PangoContext.o xs/PangoFont.o xs/PangoFontset.o xs/PangoFontMap.o
xs/PangoLayout.o xs/PangoRenderer.o xs/PangoScript.o xs/PangoTabs.o
xs/PangoTypes.o xs/GdkDisplay.o xs/GdkDisplayManager.o xs/GdkScreen.o
xs/GtkClipboard.o xs/GtkAction.o xs/GtkActionGroup.o xs/GtkCellLayout.o
xs/GtkColorButton.o xs/GtkComboBox.o xs/GtkComboBoxEntry.o
xs/GtkEntryCompletion.o xs/GtkExpander.o xs/GtkFileChooser.o
xs/GtkFileChooserDialog.o xs/GtkFileChooserWidget.o xs/GtkFileFilter.o
xs/GtkFontButton.o xs/GtkIconTheme.o xs/GtkRadioAction.o
xs/GtkRadioToolButton.o xs/GtkSeparatorToolItem.o xs/GtkToggleAction.o
xs/GtkToggleToolButton.o xs/GtkToolButton.o xs/GtkToolItem.o
xs/GtkTreeModelFilter.o xs/GtkUIManager.o xs/GdkPango.o xs/GtkAboutDialog.o
xs/GtkCellRendererCombo.o xs/GtkCellRendererProgress.o xs/GtkCellView.o
xs/GtkFileChooserButton.o xs/GtkIconView.o xs/GtkMenuToolButton.o
-Wl,--image-base,0x69100000  E:\perl-5.8.7\site\lib\auto\Glib\Glib.dll E:
\perl-5.8.7\lib\CORE\libperl58.a e:\msys\1.0\mingw\lib\libgdi32.a e:

Erm, where did the --image-base argument come from?  Does it belong with the
libperl58.a arg?


\msys\1.0\mingw\lib\libuser32.a e:\msys\1.0\mingw\lib\libgdi32.a e:
\msys\1.0\mingw\lib\libwinspool.a e:\msys\1.0\mingw\lib\libcomdlg32.a e:
\msys\1.0\mingw\lib\libadvapi32.a e:\msys\1.0\mingw\lib\libshell32.a e:
\msys\1.0\mingw\lib\libole32.a e:\msys\1.0\mingw\lib\liboleaut32.a e:
\msys\1.0\mingw\lib\libnetapi32.a e:\msys\1.0\mingw\lib\libuuid.a e:
\msys\1.0\mingw\lib\libws2_32.a e:\msys\1.0\mingw\lib\libmpr.a e:
\msys\1.0\mingw\lib\libwinmm.a e:\msys\1.0\mingw\lib\libversion.a e:

I'm fairly certain that a few of these are unnecessary.


\msys\1.0\mingw\lib\libodbc32.a dll.exp -lgtk-win32-2.0 -lgdk-win32-2.0

                                  ^^^^^^^
Is that actually necessary?  What's in the exp file?





-- 
muppet <scott at asofyet dot org>




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