Skip to main content
Topic: dwsim / mono gtk problem (Read 303 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

dwsim / mono gtk problem

This is sort of a kluge.  I'm trying to run dwsim, a process simulator.  It's written in .NET and uses mono.  It's really built for Windoze, but they have a linux deb package.  I used debtap and installed it.  It looks like they use Eto.forms, which makes cross platform programming easier.  Anyhow, I ran it and got this error message:

Code: [Select]
Mono: DllImport unable to load library 'libgdk-x11-2.0.so.0'.
Mono: DllImport unable to load library 'libgtk-x11-2.0.so.0'.
Mono: DllImport unable to load library 'libgtk-x11-2.0.so.0'.
Mono: DllImport unable to load library 'libgtk-x11-2.0.so.0'.
: libgtk-x11-2.0.so.0 assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) Gtk.Application.gtk_init_check(int&,intptr&)  (more lines deleted

So I ran this:
Code: [Select]
# ldconfig -p|grep libgtk-x11-2.0.so.0
#libgtk-x11-2.0.so.0 (libc6,x86-64) => /usr/lib/libgtk-x11-2.0.so.0

Note the package needed gtk-sharp, which wasn't listed as a dependency.  I installed it to get this far.  I don't think that factors in.

Looks like mono is puking.

I might just load the Windoze version with Bottles, but I'd rather run natively.

Thanks.

Re: dwsim / mono gtk problem

Reply #1
I found this on stack overflow:

Quote

After searching through mono logs I noticed that it's trying to access windows-specific dlls, so I tried setting library reference parameter "Copy Local" to false on these libraries:

atk-sharp
gdk-sharp
glade-sharp
glib-sharp
gtk-dotnet
gtk-sharp
pango-sharp
And it worked on ubuntu 18.04.3 LTS]

Where would "library reference paramater" be? 

Might be something to try.

Re: dwsim / mono gtk problem

Reply #2
Another update.

Found this is /etc/mono/config:

Quote
<dllmap dll="libgtk-x11-2.0" target="libgtk-x11-2.0.so.0" os="!windows"/>
Maybe adding a full path would work.

Re: dwsim / mono gtk problem

Reply #3
This is sort of a kluge.  I'm trying to run dwsim, a process simulator.  It's written in .NET and uses mono. 

... , but I'd rather run natively.

RTFM:

https://github.com/Greg66/DWSIM
"Wer alles kann, macht nichts richtig"

Artix USE="runit openrc slim openbox lxde gtk2 qt4 qt5 qt6 conky
-gtk3 -gtk4 -adwaita{cursors,themes,icons} -gnome3 -kde -plasma -wayland "

Re: dwsim / mono gtk problem

Reply #4
Thanks for the git hub link.

I already read the manual, and there's no documentation on building this for Linux.  It's already pre-built into a deb package.  I have zero experience with mono and was hoping this would be a quick config fix.




Re: dwsim / mono gtk problem

Reply #5
The link was fairly low effort as it points at a fork not the original repo

Even though the system file libgdk-x11-2.0.so.0 has the same name it's contents may differ from the debian(?) version of it that the program was compiled against.

It's a longshot but you could try getting the file from debian packages and trying to use that file when running the program.

Assumptions: the file is at /home/USER/.local/lib  , you run the program with dwsim .
Code: [Select]
LD_LIBRARY_PATH=/home/USER/.local/lib dwsim
https://packages.debian.org/search?keywords=libgtk2.0

Try a few versions. You may need to account for symlinks


Re: dwsim / mono gtk problem

Reply #6
Thanks.  I'll give it a whirl tonight.

I might also try doing a git clone and then:

Code: [Select]
xbuild DWSIM.sln

See if it compiles.

Re: dwsim / mono gtk problem

Reply #7
I already read the manual, and there's no documentation on building this for Linux.
"Wer alles kann, macht nichts richtig"

Artix USE="runit openrc slim openbox lxde gtk2 qt4 qt5 qt6 conky
-gtk3 -gtk4 -adwaita{cursors,themes,icons} -gnome3 -kde -plasma -wayland "

Re: dwsim / mono gtk problem

Reply #8
Thanks, compiling it with Visual Studios is an option.

I might give VS a whirl this weekend and post an update next week.

If I get this compiled, I'll write up a How-To for compiling/installing mono/.NET programs from git.