mono / gtk-sharp

Gtk# is a Mono/.NET binding to the cross platform Gtk+ GUI toolkit and the foundation of most GUI apps built with Mono
http://www.mono-project.com/GtkSharp
Other
426 stars 141 forks source link

Latest nugget packages won't run on Win32/Windows #229

Closed sunkin351 closed 6 years ago

sunkin351 commented 6 years ago

I'm using VS2017 to develop and build an application with GTK#, it includes the package GtkSharp.Win32(All packages are the latest as of June 3, 2018), and I am receiving a PInvokeStackImbalance error through the Application.Init() function. Any help here?

sunkin351 commented 6 years ago

Is nobody maintaining this atm? Or...?

Therzok commented 6 years ago

GtkSharp.Win32 is not maintained by mono/gtk-sharp, not sure why the project site for that nuget links here.

sunkin351 commented 6 years ago

What's the problem though? Is it not up to date with the latest sources of GTK?

Therzok commented 6 years ago

Yes, the package seems outdated. We've done quite a bit of work to fix proper pinvoke signatures in the 2.12 branch, but there wasn't any issue with App.Init()

Something you could try is forcing your main exe to build for the x86 platform, not any-cpu. That might do the trick and it should work.

Gtk# 2.x on windows 32bit only

sunkin351 commented 6 years ago

Well, there's my problem... I require 64-bit... :( Is there a workaround to match the 32-bit ABI?

Therzok commented 6 years ago

One idea that comes to mind is to manually pinvoke whatever you need and doesn't work in your app (so binding gtk_application_init) by yourself. But that's complicated.

But you're going to set yourself on a path to fixing up everything that is a mismatched size as you go by replacing API with pinvokes.

Right now, no other workaround that I know of.

There is work being done on a new generator to help with this scenario (being able to bind any gtk based on the instrospection information the libs provide), but that's on hold for a while, as I've not had time to drive the effort. This new generator would've solved the problem you're seeing.

I might be able to resume work on it in a few months, but I can't spare time now.

Therzok commented 6 years ago

Also, gtk+ 2.x on windows doesn't really work in 64bit. So I really wouldn't go there.

sunkin351 commented 6 years ago

Lovely...