Compilation problem on windows

Hi

I’m trying to compile ruby-gnome2 under windows, but I’m stopped on a
simple
problem.

The environment is latest ruby installer (git clone), ruby 1.9.1 p243,
with
1.0.11 and mingw 3.4.5.
The gtk devkit if from the official site :
http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.16/gtk+-bundle_2.16.6-20090911_win32.zip

First, when runnning ruby extconf.rb, I have :

Target libraries: glib, gio, gdkpixbuf, pango, atk, gtk
Ignored libraries: bonobo, bonoboui, gconf, gnome, gnomecanvas,
gnomeprint,
gnomeprintui,
gnomevfs, goocanvas, gstreamer, gtkglext, gtkhtml2, gtkmozembed,
gtksourceview,
gtksourceview2, libart, libgda, libglade, panel-applet, poppler, rsvg,
vte

I was wondering if anything else should be compiled on win32 ?
I think I’m missing some dependencies here.

I then got a problem with glib looking for libintl.h which was was in
c:\gtk\include, but I had to copy it in c:\gtk\include\glib-2.0.

And finally, I’m stuck with gtk not compiling the final step :

gcc -shared -s -o gtk2.so init.o rbgdk.o rbgdkatom.o rbgdkcairo.o
rbgdkcolor.o r
bgdkcolormap.o rbgdkconst.o rbgdkcursor.o rbgdkdevice.o rbgdkdisplay.o
rbgdkdisp
laymanager.o rbgdkdragcontext.o rbgdkdraw.o rbgdkevent.o rbgdkgc.o
rbgdkgeometry
.o rbgdkimage.o rbgdkinput.o rbgdkkeymap.o rbgdkkeyval.o rbgdkpango.o
rbgdkpango
renderer.o rbgdkpixbuf.o rbgdkpixmap.o rbgdkproperty.o rbgdkrectangle.o
rbgdkreg
ion.o rbgdkrgb.o rbgdkscreen.o rbgdkselection.o rbgdkthreads.o
rbgdktimecoord.o
rbgdkvisual.o rbgdkwindow.o rbgdkwindowattr.o rbgdkx11.o rbgtk.o
rbgtkaboutdialo
g.o rbgtkaccelerator.o rbgtkaccelgroup.o rbgtkaccelgroupentry.o
rbgtkaccelkey.o
rbgtkaccellabel.o rbgtkaccelmap.o rbgtkaccessible.o rbgtkaction.o
rbgtkactiongro
up.o rbgtkadjustment.o rbgtkalignment.o rbgtkallocation.o rbgtkarrow.o
rbgtkaspe
ctframe.o rbgtkassistant.o rbgtkbbox.o rbgtkbin.o rbgtkbindingset.o
rbgtkborder.
o rbgtkbox.o rbgtkbuildable.o rbgtkbuilder.o rbgtkbutton.o
rbgtkcalendar.o
rbgtk
celleditable.o rbgtkcelllayout.o rbgtkcellrenderer.o
rbgtkcellrendereraccel.o rb
gtkcellrenderercombo.o rbgtkcellrendererpixbuf.o
rbgtkcellrendererprogress.o
rbg
tkcellrendererspin.o rbgtkcellrenderertext.o rbgtkcellrenderertoggle.o
rbgtkcell
view.o rbgtkcheckbutton.o rbgtkcheckmenuitem.o rbgtkclipboard.o
rbgtkcolorbutton
.o rbgtkcolorsel.o rbgtkcolorselectiondialog.o rbgtkcombo.o
rbgtkcombobox.o
rbgt
kcomboboxentry.o rbgtkconst.o rbgtkcontainer.o rbgtkcurve.o
rbgtkdialog.o
rbgtkd
rag.o rbgtkdrawingarea.o rbgtkeditable.o rbgtkentry.o
rbgtkentrycompletion.o
rbg
tkeventbox.o rbgtkexpander.o rbgtkfilechooser.o rbgtkfilechooserbutton.o
rbgtkfi
lechooserdialog.o rbgtkfilechooserwidget.o rbgtkfilefilter.o
rbgtkfilesel.o
rbgt
kfixed.o rbgtkfontbutton.o rbgtkfontselection.o
rbgtkfontselectiondialog.o
rbgtk
frame.o rbgtkgamma.o rbgtkhandlebox.o rbgtkhbbox.o rbgtkhbox.o
rbgtkhpaned.o
rbg
tkhruler.o rbgtkhscale.o rbgtkhscrollbar.o rbgtkhseparator.o
rbgtkiconfactory.o
rbgtkiconinfo.o rbgtkiconset.o rbgtkiconsize.o rbgtkiconsource.o
rbgtkicontheme.
o rbgtkiconview.o rbgtkimage.o rbgtkimagemenuitem.o rbgtkimcontext.o
rbgtkimcont
extsimple.o rbgtkimmulticontext.o rbgtkinits.o rbgtkinputdialog.o
rbgtkinvisible
.o rbgtkitem.o rbgtkitemfactory.o rbgtklabel.o rbgtklayout.o
rbgtklinkbutton.o r
bgtkliststore.o rbgtkmain.o rbgtkmenu.o rbgtkmenubar.o rbgtkmenuitem.o
rbgtkmenu
shell.o rbgtkmenutoolbutton.o rbgtkmessagedialog.o rbgtkmisc.o
rbgtknotebook.o r
bgtkobject.o rbgtkoptionmenu.o rbgtkpagesetup.o
rbgtkpagesetupunixdialog.o
rbgtk
paned.o rbgtkpapersize.o rbgtkplug.o rbgtkprintcontext.o rbgtkprinter.o
rbgtkpri
ntjob.o rbgtkprintoperation.o rbgtkprintoperationpreview.o
rbgtkprintsettings.o
rbgtkprintunixdialog.o rbgtkprogress.o rbgtkprogressbar.o
rbgtkradioaction.o
rbg
tkradiobutton.o rbgtkradiomenuitem.o rbgtkradiotoolbutton.o rbgtkrange.o
rbgtkrc
.o rbgtkrcstyle.o rbgtkrecentaction.o rbgtkrecentchooser.o
rbgtkrecentchooserdia
log.o rbgtkrecentchoosermenu.o rbgtkrecentchooserwidget.o
rbgtkrecentdata.o
rbgt
krecentfilter.o rbgtkrecentfilterinfo.o rbgtkrecentinfo.o
rbgtkrecentmanager.o r
bgtkruler.o rbgtkscale.o rbgtkscalebutton.o rbgtkscrollbar.o
rbgtkscrolledwindow
.o rbgtkselection.o rbgtkselectiondata.o rbgtkseparator.o
rbgtkseparatormenuitem
.o rbgtkseparatortoolitem.o rbgtksettings.o rbgtksizegroup.o
rbgtksocket.o
rbgtk
spinbutton.o rbgtkstatusbar.o rbgtkstatusicon.o rbgtkstock.o
rbgtkstyle.o
rbgtkt
able.o rbgtktargetlist.o rbgtktearoffmenuitem.o rbgtktextappearance.o
rbgtktexta
ttributes.o rbgtktextbuffer.o rbgtktextchild.o rbgtktextiter.o
rbgtktextmark.o r
bgtktexttag.o rbgtktexttagtable.o rbgtktextview.o rbgtktoggleaction.o
rbgtktoggl
ebutton.o rbgtktoggletoolbutton.o rbgtktoolbar.o rbgtktoolbutton.o
rbgtktoolitem
.o rbgtktooltip.o rbgtktooltips.o rbgtktreedragdest.o
rbgtktreedragsource.o
rbgt
ktreeiter.o rbgtktreemodel.o rbgtktreemodelfilter.o rbgtktreemodelsort.o
rbgtktr
eepath.o rbgtktreerowreference.o rbgtktreeselection.o
rbgtktreesortable.o
rbgtkt
reestore.o rbgtktreeview.o rbgtktreeviewcolumn.o rbgtkuimanager.o
rbgtkvbbox.o r
bgtkvbox.o rbgtkviewport.o rbgtkvolumebutton.o rbgtkvpaned.o
rbgtkvruler.o
rbgtk
vscale.o rbgtkvscrollbar.o rbgtkvseparator.o rbgtkwidget.o rbgtkwindow.o
rbgtkwi
ndowgroup.o -L. -Lc:/ruby/lib -L. -Lc:/gtk/lib -Lc:/gtk/lib
-Lc:/gtk/lib
-LE:/p
rogrammation/ruby-gnome2/glib/src
-LE:/programmation/ruby-gnome2/glib/src
-LE:/p
rogrammation/ruby-gnome2/pango/src
-LE:/programmation/ruby-gnome2/pango/src
-LE:
/programmation/ruby-gnome2/gtk/src
-LE:/programmation/ruby-gnome2/gtk/src
-Wl,–
enable-auto-image-base,–enable-auto-import,–out-implib=libruby-gtk2.a
-lmsvc
rt-ruby191 -lgthread-2.0 -lglib-2.0 -lintl -lgtk-win32-2.0
-lgdk-win32-2.0 -l
atk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32
-lpangocairo-1.0
-lp
ango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -lcairo
-lrub
y-glib2 -lruby-glib2 -lruby-pango -lruby-pango -lruby-gtk2 -lruby-gtk2
-lshell32
-lws2_32
C:\mingw\bin..\lib\gcc\mingw32\3.4.5........\mingw32\bin\ld.exe:
cannot
fin
d -lruby-gtk2
collect2: ld returned 1 exit status
make[1]: *** [gtk2.so] Error 1
make[1]: Leaving directory `/e/programmation/ruby-gnome2/gtk/src’
make: *** [all] Error 2

Any ideas wthat’s wrong ?

Simon A.

On Wed, Oct 14, 2009 at 08:51, Nikolai W. [email protected] wrote:

On Wed, Oct 14, 2009 at 00:35, Simon A. [email protected] wrote:

And finally, I’m stuck with gtk not compiling the final step :

C:\mingw\bin..\lib\gcc\mingw32\3.4.5........\mingw32\bin\ld.exe: cannot
fin
d -lruby-gtk2
collect2: ld returned 1 exit status
make[1]: *** [gtk2.so] Error 1

It tries to link to ruby-gtk2 for some reason. Â I had the same
problem, but I figured it was a problem with my setup and didn’t
report it. Â All you need to do is remove -lruby-gtk2 from the
definition of LIBS in gtk/src/Makefile and run make.

Did you get any further? I tried compiling against 1.9 today, but it
wont link gtk or pango. It complains about missing functions that
should be exported to ruby-glib2. I have no idea of how to solve it.
Has anyone gotten further?

On Wed, Oct 14, 2009 at 00:35, Simon A. [email protected] wrote:

First, when runnning ruby extconf.rb, I have :

rbgdkgeometry
rbgtkaccellabel.o rbgtkaccelmap.o rbgtkaccessible.o rbgtkaction.o
rbg
tkeventbox.o rbgtkexpander.o rbgtkfilechooser.o rbgtkfilechooserbutton.o
rbgtkicontheme.
bgtkobject.o rbgtkoptionmenu.o rbgtkpagesetup.o rbgtkpagesetupunixdialog.o
rbgtkrecentchooserdia
spinbutton.o rbgtkstatusbar.o rbgtkstatusicon.o rbgtkstock.o rbgtkstyle.o
rbgt
ndowgroup.o -L. -Lc:/ruby/lib -L. -Lc:/gtk/lib -Lc:/gtk/lib -Lc:/gtk/lib
-lgdk-win32-2.0 -l
collect2: ld returned 1 exit status
make[1]: *** [gtk2.so] Error 1

It tries to link to ruby-gtk2 for some reason. I had the same
problem, but I figured it was a problem with my setup and didn’t
report it. All you need to do is remove -lruby-gtk2 from the
definition of LIBS in gtk/src/Makefile and run make.

2009/10/20 Nikolai W. [email protected]

Did you get any further? I tried compiling against 1.9 today, but it
wont link gtk or pango. It complains about missing functions that
should be exported to ruby-glib2. I have no idea of how to solve it.
Has anyone gotten further?

I had a problem with 1.9 if I remember well, and I needed a working copy
for
a demo, so I went with 1.8. I don’t remember exactly what it was.

I would like to have an installer, but it’s not high on my todo list.

I will see if I can find some time to retest 1.9, and see what failed.

regards

Simon

On Tue, Oct 20, 2009 at 20:06, Nikolai W. [email protected] wrote:

Did you get any further? Â I tried compiling against 1.9 today, but it
wont link gtk or pango. Â It complains about missing functions that
should be exported to ruby-glib2. Â I have no idea of how to solve it.
Has anyone gotten further?

I got it working. The problem was that Ruby 1.9 doesn’t include
–export-all in the dldflags.

RubyInstaller Developers: Is this perhaps a problem with the set-up of
Ruby 1.9 on Windows? It’s all down to DLDFLAGS being set
“incorrectly” in 1.9.1\i386-mingw32\rbconfig.rb, at least in
ruby-1.9.1-p243. (To provide some context, there was a problem when
compiling ruby-gnome2 on Windows. In ruby-1.8.6-p383, DLDFLAGS
includes --export-all and everything works fine.)