Skip to content

Draft: Windowsxwtgtk3: Do not merge #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 400 commits into
base: main
Choose a base branch
from

Conversation

MakiWolf
Copy link

Played here also with gtk3, but at least it did not start.

I have installed gtksharp using this guide:

https://github.com/GtkSharp/GtkSharp/wiki/Installing-Gtk-on-Windows

I also tried starting it with msys2

INFO [2024-02-13 23:18:49Z]: Starting MonoDevelop 8.6 Preview (8.6 build 1295)
INFO [2024-02-13 23:18:49Z]: Build Information
86738549e095c384e2435d38c2eb695f59be7c95

INFO [2024-02-13 23:18:49Z]: Running on Microsoft .NET 4.0.30319.42000
INFO [2024-02-13 23:18:49Z]: Operating System: Windows 10.0.22631.0 (64-bit)
INFO [2024-02-13 23:18:49Z]: Found GTK# version 2.12.45
FATAL ERROR [2024-02-13 23:18:49Z]: MonoDevelop failed to start. Some of the assemblies required to run MonoDevelop (for example gtk-sharp)may not be properly installed in the GAC.
System.TypeInitializationException: Der Typeninitialisierer für "Gtk.Settings" hat eine Ausnahme verursacht. ---> System.DllNotFoundException: Gtk: libgtk-3-0.dll, libgtk-3.so.0, libgtk-3.0.dylib, gtk-3.dll
   bei GLibrary.Load(Library library)
   bei Gtk.Settings..cctor()
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei Gtk.Settings.get_Default()
   bei MonoDevelop.Components.IdeTheme.InitializeGtk(String progname, String[]& args) in C:\msys64\home\Marku\windowsxwtgtk3\main\src\core\MonoDevelop.Ide\MonoDevelop.Components\IdeTheme.cs:Zeile 77.
   bei MonoDevelop.Ide.IdeStartup.Run(MonoDevelopOptions options) in C:\msys64\home\Marku\windowsxwtgtk3\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide\IdeStartup.cs:Zeile 130.
   bei MonoDevelop.Ide.IdeStartup.Main(String[] args, IdeCustomizer customizer) in C:\msys64\home\Marku\windowsxwtgtk3\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide\IdeStartup.cs:Zeile 755.

I also installed then
https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer

but this did not solve the error

I think it uses gtksharp2 installation from this line:

https://github.com/MakiWolf/dotdevelop/blob/7dc1f75236d71b4a995caed84fee7b192be126b9/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Platform.cs#L102

I also don't know if gtksharp have a registry path to replace gtk2 here?

@badcel
Copy link

badcel commented Apr 6, 2024

Also tried to use original gtksharp from mono on windows and it also does not start. The problem seems to be in the xwt backend, also in the original one from mono.

I used this .msi installer under https://github.com/mono/gtk-sharp/releases/tag/2.99.3

INFO [2024-03-18 11:17:26Z]: Starting MonoDevelop 8.6 Preview (8.6 build 1384)
INFO [2024-03-18 11:17:26Z]: Build Information
7dd1edbdc098a414c77e408b537901d481a07cf4

INFO [2024-03-18 11:17:26Z]: Running on Microsoft .NET 4.0.30319.42000
INFO [2024-03-18 11:17:26Z]: Operating System: Windows 10.0.22631.0 (64-bit)
INFO [2024-03-18 11:17:26Z]: Found GTK# version 2.12.45
INFO [2024-03-18 11:17:26Z]: Using GTK+ 3
FATAL ERROR [2024-03-18 11:17:26Z]: MonoDevelop failed to start. Some of the assemblies required to run MonoDevelop (for example gtk-sharp)may not be properly installed in the GAC.
System.Exception: Toolkit could not be loaded ---> System.BadImageFormatException: Es wurde versucht, eine Datei mit einem falschen Format zu laden. (Ausnahme von HRESULT: 0x8007000B)
   bei Gtk.Application.gtk_init(Int32& argc, IntPtr& argv)
   bei Gtk.Application.Init()
   bei Xwt.GtkBackend.GtkEngine.InitializeApplication() in C:\msys64\home\Marku\hackweek2nugetgtkxwtgtk3\main\external\xwt3\Xwt.Gtk\Xwt.GtkBackend\GtkEngine.cs:Zeile 45.
   bei Xwt.Backends.ToolkitEngineBackend.Initialize(Toolkit toolkit, Boolean isGuest, Boolean initializeToolkit) in C:\msys64\home\Marku\hackweek2nugetgtkxwtgtk3\main\external\xwt3\Xwt\Xwt.Backends\ToolkitEngineBackend.cs:Zeile 61.
   bei Xwt.Toolkit.Initialize(Boolean isGuest, Boolean initializeToolkit) in C:\msys64\home\Marku\hackweek2nugetgtkxwtgtk3\main\external\xwt3\Xwt\Xwt\Toolkit.cs:Zeile 306.
   bei Xwt.Toolkit.LoadBackend(String type, Boolean isGuest, Boolean initializeToolkit, Boolean throwIfFails) in C:\msys64\home\Marku\hackweek2nugetgtkxwtgtk3\main\external\xwt3\Xwt\Xwt\Toolkit.cs:Zeile 289.
   --- Ende der internen Ausnahmestapel▒berwachung ---
   bei Xwt.Toolkit.LoadBackend(String type, Boolean isGuest, Boolean initializeToolkit, Boolean throwIfFails) in C:\msys64\home\Marku\hackweek2nugetgtkxwtgtk3\main\external\xwt3\Xwt\Xwt\Toolkit.cs:Zeile 296.
   bei Xwt.Toolkit.Load(String fullTypeName, Boolean isGuest, Boolean initializeToolkit) in C:\msys64\home\Marku\hackweek2nugetgtkxwtgtk3\main\external\xwt3\Xwt\Xwt\Toolkit.cs:Zeile 207.
   bei Xwt.Application.Initialize(String backendType, Boolean initializeToolkit) in C:\msys64\home\Marku\hackweek2nugetgtkxwtgtk3\main\external\xwt3\Xwt\Xwt\Application.cs:Zeile 116.
   bei Xwt.Application.Initialize(ToolkitType type) in C:\msys64\home\Marku\hackweek2nugetgtkxwtgtk3\main\external\xwt3\Xwt\Xwt\Application.cs:Zeile 93.
   bei Xwt.Application.InitializeAsGuest(ToolkitType type) in C:\msys64\home\Marku\hackweek2nugetgtkxwtgtk3\main\external\xwt3\Xwt\Xwt\Application.cs:Zeile 132.
   bei MonoDevelop.Ide.IdeStartup.Run(MonoDevelopOptions options) in C:\msys64\home\Marku\hackweek2nugetgtkxwtgtk3\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide\IdeStartup.cs:Zeile 163.
   bei MonoDevelop.Ide.IdeStartup.Main(String[] args, IdeCustomizer customizer) in C:\msys64\home\Marku\hackweek2nugetgtkxwtgtk3\main\src\core\MonoDevelop.Ide\MonoDevelop.Ide\IdeStartup.cs:Zeile 755.

Test branch: https://github.com/MakiWolf/dotdevelop/tree/hackweek2nugetgtkxwtgtk3

I assume the problem here is that you installed the 32 bit version of the libraries but are executing a 64 bit application?

@MakiWolf
Copy link
Author

MakiWolf commented Apr 6, 2024

I assume the problem here is that you installed the 32 bit version of the libraries but are executing a 64 bit application?

The original mono gtk3 installer have only a 32 bit version. And using the new nuget package and the libraries from msys2 also have not worked.

https://github.com/GtkSharp/GtkSharp/wiki/Installing-Gtk-on-Windows

But on GTK2 under this branch the 32bit installation of the libraries worked: https://github.com/MakiWolf/dotdevelop/tree/windowslinuxbuild

@MakiWolf
Copy link
Author

Another strange thing when I use this working gtk2 branch under https://github.com/MakiWolf/dotdevelop/tree/windowslinuxbuild
And make in this line a Console Output with WriteLine

https://github.com/easysimplified/xwt/blob/042a2c85edb02447f45a65aa1a46fd9cbbcf6dbf/Xwt.Gtk/Xwt.GtkBackend/GtkEngine.cs#L135

Console.WriteLine("loc:"+loc);

It outputs:

loc:C:\msys64\home\Marku\windowslinuxbuild\main\build\bin\Xwt.Gtk.Windows.dll

strange when I look with a file manager here there is no file Xwt.Gtk.Windows.dll only a file without windows in the name!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants