Artix Linux Forum

Artix Linux => Applications & Software => Topic started by: jadep on 19 September 2024, 04:44:58

Title: dwsim / mono gtk problem
Post by: jadep on 19 September 2024, 04:44:58
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.
Title: Re: dwsim / mono gtk problem
Post by: jadep on 19 September 2024, 04:47:19
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.
Title: Re: dwsim / mono gtk problem
Post by: jadep on 19 September 2024, 05:12:33
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.
Title: Re: dwsim / mono gtk problem
Post by: lq on 19 September 2024, 08:15:41
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
Title: Re: dwsim / mono gtk problem
Post by: jadep on 19 September 2024, 15:47:41
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.



Title: Re: dwsim / mono gtk problem
Post by: gripped on 19 September 2024, 17:49:25
The link was fairly low effort as it points at a fork not the original repo (https://github.com/DanWBR/dwsim)

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

Title: Re: dwsim / mono gtk problem
Post by: jadep on 19 September 2024, 19:04:04
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.
Title: Re: dwsim / mono gtk problem
Post by: lq on 20 September 2024, 07:30:23
I already read the manual, and there's no documentation on building this for Linux.
Title: Re: dwsim / mono gtk problem
Post by: jadep on 20 September 2024, 16:45:12
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.