Re: Threading woes
Jacques Garrigue <[email protected]> Sat, 06 Feb 2010 14:25:08 +0900 (JST)
| Newsgroups | gmane.comp.lang.ocaml.lib.gtk |
|---|---|
| Message-ID | <[email protected]> |
From: Jon Harrop <[email protected]> > and am compiling with: > > ocamlopt -annot -thread -I +lablgtk2 -I +lablgtkgl2 -I +lablgl lablgl.cmxa > lablgtk.cmxa lablgtkgl.cmxa unix.cmxa threads.cmxa gtkThread.cmx x.ml -o x > > but when I run the resulting program I get a segfault: > > $ ./x > > (process:15948): GLib-GObject-WARNING **: invalid (NULL) pointer instance > > (process:15948): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion > `G_TYPE_CHECK_INSTANCE (instance)' failed > Segmentation fault > > What am I doing wrong? This just looks like you didn't initialize gtk. You need either to add a call to GMain.init or to link with gtkInit.cmx. Cheers, Jacques