Re: Simple GTK3 application in Nim?

Found the problem.
To solve it the Nim application needs to load it's shared libraries with dlopen(RTLD_GLOBAL).

From: gtk-app-devel-list <gtk-app-devel-list-bounces gnome org> on behalf of Matic Kukovec via 
gtk-app-devel-list <gtk-app-devel-list gnome org>
Sent: Thursday, June 28, 2018 8:34 PM
To: gtk-app-devel-list gnome org
Subject: Simple GTK3 application in Nim?

Hi guys,

I have a very simple application written in the Nim programming language, which transpiles to C and is then 
compiled with GCC on Linux.
The application is very simple and uses the IUP shared library which underneath uses GTK3. Here is the code, 
just for reference:
import os
import iup, nil)
var font_dialog = fontDlg()
font_dialog.popup(IUP_CURRENT, IUP_CURRENT)

When running the application, this error is thrown:
$ ./test

(test:6635): Gtk-WARNING **: Unknown type PangoFontFamily specified in treemodel model

(test:6635): Gtk-WARNING **: Unknown type PangoFontFace specified in treemodel model

(test:6635): Gtk-WARNING **: /home/pi/gtk+3.0-3.22.11/./gtk/gtkliststore.c:516: Invalid type (null)

(test:6635): Gtk-WARNING **: /home/pi/gtk+3.0-3.22.11/./gtk/gtkliststore.c:516: Invalid type (null)

(test:6635): GLib-GObject-CRITICAL **: g_value_type_transformable: assertion 'G_TYPE_IS_VALUE (src_type)' 

(shutdown:6635): GLib-GObject-CRITICAL **: g_value_type_transformable: assertion 'G_TYPE_IS_VALUE (src_type)' 

(test:6635): GLib-GObject-WARNING **: /build/glib2.0-F5w919/glib2.0-2.50.3/./gobject/gtype.c:4264: type id 
'0' is invalid

(test:6635): GLib-GObject-WARNING **: can't peek value table for type '<invalid>' which is not currently 
Traceback (most recent call last)
test.nim(7)         test
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

Now the problem, as far as I can guess, is that Nim behind the scenes uses the dlopen function to link to the 
IUP shared library, which messes up something with GTK.
I may be completely wrong on this, I drew this conclusion from this wxWidgets issue:

Can someone point me in a direction of how this can be fixed, because I do not have enough experience with 
this subject?

Thank you,
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]