I just compiled ruby-gtk2-0.19.4 with ruby 1.9.2 (mingw) on my windows 7
64bit. Its quite a painful process that I spend hours just to compile
it. There is nothing wrong with the ruby-gnome code but the Makefile
like include directory, lib directory missing and even the Makefile
don’t produce the static library .a file if you don’t do some
modification.
I compile with rcairo-1.8.5. It has some error with rb_errinfo (not sure
why the extconf.rb doesn’t detect the correct setting, I just modify the
code to use the correct rb_errinfo)
compiling glib found missing libintl.h, this is easy just add the path
manually to the Makefile. Then it should compile without problem. The
only thing is it might not found the ruby-cairo although you set the
correct path. Looking at the Makefile, it appends src at my cairo path
which is not correct(I think the older version of the rcairo has a src
directory?), just remove the src should make it compile. At last, which
I had struggle for long time is it doesn’t produce the static library
for glib. After searching around on the net, I had to modify the
following line in Makefile(apply for gtk, pango and etc…):
-dldflags = -Wl,–enable-auto-image-base,–enable-auto-import
$(DEFFILE),–out-implib=libruby-glib2.a
+dldflags =
-Wl,–out-implib=libruby-glib2.a,–enable-auto-image-base,–enable-auto-import
$(DEFFILE)
Just do the same tricks for others like pango, atk…etc. Move the
–out-implib to the front.
In the end when come to compile gtk. I face another error. It state that
libruby-gtk2.a not found. I have no idea why this happend. So, I just
remove the -lruby-gtk2 and let it create the libruby-gtk2.a. After that,
I added back the -lruby-gtk2 into it and compile again. But it still
give me another error where it can’t export some function like
rbgtk_clipboard_get_type, rbgtk_make_clipboard, …etc. Looking at the
gtk2.def, all the function which not able to export is rbgtk function
which had DATA at the end. I just remove the DATA at the function in the
gtk2.def file and it able to compile successfully and install. I was
able to run the gtk-demo in the src code without problem, no extensive
testing since I am just compile this for fun.
Any can explain what the impact I remove the DATA from the gtk2.def,
here is the gtk2.def after I made changes(some rbgtk function had DATA
but I just remove it):
EXPORTS
Init_gtk2
mGdk DATA
rb_cGdkColor DATA
mGtk DATA
exec_callback
gdk_atom_copy
gdk_atom_get_type
gdk_geometry_get_type
gdk_region_get_type
gdk_windowattr_get_type
get_gdkatom
get_gdkevent
gtk_accel_group_entry_get_type
gtk_accel_key_get_type
gtk_notebookpage_get_type
gtk_target_list_get_type
gtk_bindingset_get_type
make_gdkevent
notebookpage_copy
rbgtk_atom2selectiondata
rbgtk_atom2selectiondata_free
rbgtk_clipboard_get_type
rbgtk_get_clipboard
rbgtk_make_clipboard
rbgtk_get_target_entry
rbgtk_get_tree_row_reference
rbgtk_initialize_gtkobject
rbgtk_register_treeiter_set_value_func
rbgtk_tree_row_reference_get_type
gtk_text_appearance_get_type DATA
rbgtk_dialog_add_buttons_internal