[Lablgtk] Cairo/GTK and cube example

Johan Mazel johan.mazel at gmail.com
Tue Sep 14 11:50:15 CEST 2010


Hi
I'm trying to use Cairo and GTK.
As a first step, I tried to compile and understand the cube example given at
this address: http://webcvs.cairographics.org/cairo-ocaml/test/.
I use this line for the native compilation: ocamlopt -I +lablgtk2 -I +cairo
lablgtk.cmxa cairo.cmxa cairo_lablgtk.cmxa cube.ml -o cube.

The first problem is that the bytecode compilation do not work:
ocamlc -I +lablgtk2 -I +cairo lablgtk.cma cairo.cma cairo_lablgtk.cma
cube.ml -o cube
File "cube.ml", line 1, characters 0-1:
Error: Error on dynamically loaded library:
/usr/lib/ocaml/stublibs/dllmlcairo.so:
/usr/lib/ocaml/stublibs/dllmlcairo.so: undefined symbol: caml_ba_byte_size

I however tried to run the native executable generated but I get the
following error:
(process:6496): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(process:6496): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion
`G_TYPE_CHECK_INSTANCE (instance)' failed
(process:6496): Gdk-CRITICAL **: gdk_pango_context_get_for_screen: assertion
`GDK_IS_SCREEN (screen)' failed
(process:6496): Pango-CRITICAL **: pango_context_set_font_description:
assertion `context != NULL' failed
(process:6496): Pango-CRITICAL **: pango_context_set_base_dir: assertion
`context != NULL' failed
(process:6496): Pango-CRITICAL **: pango_context_set_language: assertion
`context != NULL' failed
(process:6496): Pango-CRITICAL **: pango_layout_new: assertion `context !=
NULL' failed
(process:6496): Pango-CRITICAL **: pango_layout_set_text: assertion `layout
!= NULL' failed
(process:6496): Pango-CRITICAL **: pango_layout_get_pixel_extents: assertion
`PANGO_IS_LAYOUT (layout)' failed
(process:6496): Pango-CRITICAL **: pango_layout_set_text: assertion `layout
!= NULL' failed
(process:6496): Pango-CRITICAL **: pango_layout_get_pixel_extents: assertion
`PANGO_IS_LAYOUT (layout)' failed
(process:6496): GLib-GObject-CRITICAL **: g_object_unref: assertion
`G_IS_OBJECT (object)' failed
(process:6496): Gtk-WARNING **: Screen for GtkWindow not set; you must
always set
a screen for a GtkWindow before using the window
(process:6496): Gdk-CRITICAL **: gdk_pango_context_get_for_screen: assertion
`GDK_IS_SCREEN (screen)' failed
(process:6496): Pango-CRITICAL **: pango_context_set_font_description:
assertion `context != NULL' failed
(process:6496): Pango-CRITICAL **: pango_context_set_base_dir: assertion
`context != NULL' failed
(process:6496): Pango-CRITICAL **: pango_context_set_language: assertion
`context != NULL' failed
(process:6496): Pango-CRITICAL **: pango_layout_new: assertion `context !=
NULL' failed
(process:6496): GLib-GObject-CRITICAL **: g_object_unref: assertion
`G_IS_OBJECT (object)' failed
(process:6496): Gdk-CRITICAL **: gdk_pango_context_get_for_screen: assertion
`GDK_IS_SCREEN (screen)' failed
(process:6496): Pango-CRITICAL **: pango_context_set_font_description:
assertion `context != NULL' failed
(process:6496): Pango-CRITICAL **: pango_context_set_base_dir: assertion
`context != NULL' failed
(process:6496): Pango-CRITICAL **: pango_context_set_language: assertion
`context != NULL' failed
(process:6496): Pango-CRITICAL **: pango_layout_new: assertion `context !=
NULL' failed
(process:6496): Pango-CRITICAL **: pango_layout_set_text: assertion `layout
!= NULL' failed
(process:6496): Pango-CRITICAL **: pango_layout_set_alignment: assertion
`layout != NULL' failed
(process:6496): Pango-CRITICAL **: pango_layout_set_ellipsize: assertion
`PANGO_IS_LAYOUT (layout)' failed
(process:6496): Pango-CRITICAL **: pango_layout_set_single_paragraph_mode:
assertion `PANGO_IS_LAYOUT (layout)' failed
(process:6496): Pango-CRITICAL **: pango_layout_set_width: assertion `layout
!= NULL' failed
(process:6496): Pango-CRITICAL **: pango_layout_get_extents: assertion
`layout != NULL' failed
(process:6496): Gdk-CRITICAL **: gdk_screen_get_default_colormap: assertion
`GDK_IS_SCREEN (screen)' failed
(process:6496): Gdk-CRITICAL **: gdk_colormap_get_visual: assertion
`GDK_IS_COLORMAP (colormap)' failed
(process:6496): Gdk-CRITICAL **: gdk_screen_get_default_colormap: assertion
`GDK_IS_SCREEN (screen)' failed
(process:6496): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion
`GDK_IS_SCREEN (screen)' failed
(process:6496): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion
`GDK_IS_SCREEN (screen)' failed
(process:6496): Gdk-CRITICAL **: gdk_window_new: assertion `GDK_IS_WINDOW
(parent)' failed
Erreur de segmentation

I am guessing that this might be linked to the compilation error in bytecode
but since I am not a specialist of lablgtk or cairo at all, I don't really
know how to fix this.

Thanks in advance for your time.

Regards.
Johan Mazel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocamlcore.org/pipermail/lablgtk-list/attachments/20100914/6542f6a8/attachment.htm>
-------------- next part --------------
_______________________________________________
Lablgtk mailing list
Lablgtk at yquem.inria.fr
http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk


More information about the Lablgtk-list mailing list