Alright, I'm at a complete loss. I've been messing with Gtk# and Mono for the past two hours and have yet to get anywhere.
I've installed Mono as well as GtkSharp using the links available on Mono's website. I have also installed Gtk itself from their website using MSYS2.
The full code of my application is below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Gtk;
namespace InstallCheck {
public class GtkSharpTest {
public static void Main() {
Application.Init();
Window window = new Window("Hello Mono World");
window.Show();
Application.Run();
}
}
}
In Visual Studio, I've added references to glib-sharp.dll and gtk-sharp.dll. It builds just fine, but when I go to run it using mono InstallCheck.exe
, I get this error:
Unhandled Exception:
System.DllNotFoundException: libglib-2.0-0.dll
at (wrapper managed-to-native) GLib.Marshaller.g_utf16_to_utf8(char*,intptr,intptr,intptr,intptr&)
at GLib.Marshaller.StringToPtrGStrdup (System.String str) [0x00034] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at GLib.Global.set_ProgramName (System.String value) [0x00001] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at Gtk.Application.SetPrgname () [0x0000d] in <35293b6aa2744433b0e2f41f34e699d5>:0
at Gtk.Application.Init () [0x00001] in <35293b6aa2744433b0e2f41f34e699d5>:0
at InstallCheck.GtkSharpTest.Run () [0x00001] in <f385106059954ecb8802348d7a6abfe1>:0
at InstallCheck.GtkSharpTest.Main (System.String[] args) [0x00027] in <f385106059954ecb8802348d7a6abfe1>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: libglib-2.0-0.dll
at (wrapper managed-to-native) GLib.Marshaller.g_utf16_to_utf8(char*,intptr,intptr,intptr,intptr&)
at GLib.Marshaller.StringToPtrGStrdup (System.String str) [0x00034] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at GLib.Global.set_ProgramName (System.String value) [0x00001] in <d973ca9f8b494b789fba7fe0ad040b14>:0
at Gtk.Application.SetPrgname () [0x0000d] in <35293b6aa2744433b0e2f41f34e699d5>:0
at Gtk.Application.Init () [0x00001] in <35293b6aa2744433b0e2f41f34e699d5>:0
at InstallCheck.GtkSharpTest.Run () [0x00001] in <f385106059954ecb8802348d7a6abfe1>:0
at InstallCheck.GtkSharpTest.Main (System.String[] args) [0x00027] in <f385106059954ecb8802348d7a6abfe1>:0
I have no idea what this means. I've Google'd and Bing'd it, and things came up, but the solutions they provided did not work. Yes, Mono is in my Path, and yes, GtkSharp is also in my Path. What am I doing wrong? Is this a GTK Error, a Mono Error, or a VS2017 error? How do I fix it? Thanks in advance.
Edit: I have now attempted to DOWNGRADE Gtk, as recommended by this issue, but that still did not work.
libglib-2.0-0.dll
? – SushiHangover