I wrote little app using gtk2hs on Linux and it works great. Latter I tryed to run that same app on Windows (xp, 7) but with no success. I installed:
And everything compiles and links OK. When trying to run that app it says:
c:\wordtrend>Main
(Main.exe:3228): GLib-GObject-CRITICAL **: gtype.c:2708: You forgot to call g_ty
pe_init()
(Main.exe:3228): GLib-GObject-CRITICAL **: gtype.c:2708: You forgot to call g_ty
pe_init()
(Main.exe:3228): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: as
sertion `G_TYPE_IS_INTERFACE (interface_type)' failed
(Main.exe:3228): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertio
n `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
(Main.exe:3228): GLib-GObject-CRITICAL **: gtype.c:2708: You forgot to call g_ty
pe_init()
(Main.exe:3228): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertio
n `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
(Main.exe:3228): GLib-GObject-CRITICAL **: gtype.c:2708: You forgot to call g_ty
pe_init()
(Main.exe:3228): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertio
n `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
(Main.exe:3228): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OB
JECT (object_type)' failed
Segmentation fault/access violation in generated code
I dont know where to start from.
SOLVED: So it appears there must be no commands before gtk2hs:initGUI function on Windows.
Code below works on Linux but compiles and chrases on Windows:
main :: IO ()
main = do
someCommand -- this command must come after initGUI to run
initGUI
...
mainGUI
So don't put any commands before initGUI command.