Delivered-To: garrigue at math.nagoya-u.ac.jp Authentication-Results: mailhost.math.nagoya-u.ac.jp sender=lablgtk-bounces at yquem.inria.fr; domainkey=neutral (no query protocol specified; no policy for yquem.inria.fr) Delivered-To: lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=pkNIv+h1msG/4wtsigecV4lbRgOEoJlJfHS59R/IgSc=; b=mS6DefE2xZEkxLNh/f1Z6mq6RzaTDbwCLFrcYWP+dzipplZOYDh+sHbg1A50sphSLI a47F846K5VTqQEXxPvluMuRfms8ZRdV6fsBDUXrgRwlSCtLrRQhjmDsHgIiQmGpgGXLK vNfKuYEiSTFZ0xa9AjUNaaUQkZOAckrVa4VP8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=O86zJFThLl7CK2aAwhp2ZGwWOgXSsyE/ZnKY8M968D3sgTvWEV8JLgQ9SyZyTBiA+o 3OflNBgwtRWrfJe/QQMFubrQFBlnXDvr9OISXbsexGw2FgA8tXFhGQOZunZhMVQ2w9hD /LHXLQO0uQH6LWMDsIuBedTV6eV03/Asbou1g= MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 14 Sep 2010 13:47:05 +0200 Message-ID: Subject: Re: [Lablgtk] Cairo/GTK and cube example From: Olivier Andrieu To: Johan Mazel Content-Type: text/plain; charset=ISO-8859-1 Cc: lablgtk at yquem.inria.fr Status: U Hi ! On Tue, Sep 14, 2010 at 11:50, Johan Mazel wrote: > 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/. btw the current code is in the git repository, not CVS: http://cgit.freedesktop.org/cairo-ocaml/ > 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 This looks like some binary incompatibility between ocaml and your cairo-ocaml binary. caml_ba_byte_size is a symbol from the Bigarray library that got renamed at some point. Did you compile cairo-ocaml yourself ? If no, you have to ensure that you're using it with the same OCaml version that compiled it. > 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 probably simply the gtk initialization missing. Add gtkInit.cmx before cube.ml while linking. -- Olivier _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk