Ticket #1197 (new defect)

Opened 4 years ago

Last modified 4 years ago

Windows/Gtk2hs : Can't load `gtk` package on GHCi

Reported by: guest Owned by: somebody
Priority: normal Milestone: 0.11.0
Component: general (Gtk+, Glib) Version: 0.11.0
Keywords: Cc: matthias.reisner@…

Description

Loading package gtk-0.11.0 ... linking

... <interactive>: c:\ghc\ghc-6.10.4\ext-lib\gtk-0.11.0\HSgtk-0.11.0.o: unknown symbol __imp__gdk_threads_lock': unable to load package gtk-0.11.0 in GHCi.

Attachments

GhciFix.patch (11.3 kB) - added by guest 4 years ago.
Disable redundant locking code on Win32
BetterFix.patch (11.3 kB) - added by guest 4 years ago.
Use gdk_threads_enter/leave instead of GTK_THREADS_ENTER/LEAVE

Change History

Changed 4 years ago by guest

Disable redundant locking code on Win32

Changed 4 years ago by guest

This is caused by GDK_THREADS_ENTER and GDK_THREADS_LEAVE in hsgthread.c. I don't think these actually do any good on Win32 because the documentation here... http://library.gnome.org/devel/gdk/stable/gdk-Threads.html says... "Unfortunately the above holds with the X11 backend only. With the Win32 backend, GDK calls should not be attempted from multiple threads at all."

So the attached patch simply disables the macros so they do nothing. Users wanting to port their Gtk2Hs apps to Win32 will need to continue to take care to call GDK from only one OS thread.

Hamish

Changed 4 years ago by guest

Use gdk_threads_enter/leave instead of GTK_THREADS_ENTER/LEAVE

Note: See TracTickets for help on using tickets.