ASoftTech / Gtk3-Sharp-Core

GtkSharp adapted to compile for .Net core
8 stars 0 forks source link

GType.g_type_init() does not find libgobject-2.0-0.dll #1

Open julian-villing opened 6 years ago

julian-villing commented 6 years ago

Error Message:

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Gtk.Application' threw an exception.
---> System.TypeInitializationException: The type initializer for 'GLib.GType' threw an exception.
---> System.DllNotFoundException: Unable to loadDLL 'libgobject-2.0-0.dll': The specified module or one of its dependencies could not be found.

Stacktrace:

 (Exception from HRESULT: 0x8007007E)
    at GLib.GType.g_type_init()
    at GLib.GType..cctor() in .../gtk3-sharp-core/Source/Libs/GLib/GType.cs:line 126
    --- End of inner exception stack trace ---
    at GLib.GType.op_Explicit(Type type) in .../gtk3-sharp-core/Source/Libs/GLib/GType.cs:line 148
    at Gtk.Application..cctor() in .../gtk3-sharp-core/Source/Libs/Gtk/generated/Gtk/Application.cs:line 223
    --- End of inner exception stack trace ---
    at Gtk.Application.Init() in .../gtk3-sharp-core/Source/Libs/Gtk/Application.cs:line 73
    at CraftingHelper.Gui.Program.Main(String[] args) in .../gtk-test/gtk-test/Program.cs:line 10

(Line 10 effectively calls Application.Init())

If there is anything I can do in order to resolve this problem or help the whole project, I'm there :-)

It seems like changing the DllImport-Attributes value from libgobject-2.0-0.dll to the correct libgobject-2.0.so would help for linux but this behaviour would not be interchangeable...

I'm using ArchLinux/Antergos and dotnet core 2.0.0 (1:2.0.0-3)

julian-villing commented 6 years ago

Workaround: Replace "libgobject-2.0-0.dll" with "libgobject-2.0.so" in Global.cs

Hecatron commented 6 years ago

Things outstanding

At the moment the source is just a copy / paste of the existing gtksharp (for gtk 3.0) but with python scripts to generate the source code

julian-villing commented 6 years ago

I have ported the libraries to Linux, if you are interested. It works now and I was able to compile and run a simple demo application

Hecatron commented 6 years ago

I'm quite surprised at that since this project is really only half done

julian-villing commented 6 years ago

Demo-Image Main Window Code