gircore / gir.core

A C# binding generator for GObject based libraries providing a C# friendly API surface
https://gircore.github.io/
MIT License
307 stars 28 forks source link

Loading native libgtksourceview shared library failed #1082

Closed lamg closed 3 months ago

lamg commented 3 months ago

Description

A basic example using GtkSource fails to run with the following output

UnhandledException - unhandled exception: System.DllNotFoundException: Unable to load shared library 'GtkSource' or
one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable

Steps to reproduce

Investigating the issue

Inspecting the output at result.txt

badcel commented 3 months ago

Actually it should be looking for libgtksourceview-5.so.0 as it is defined in the Gir file from the GNOME sdk.

Can you confirm this file is available?

Which version of Ubuntu are you using?

lamg commented 3 months ago

I assumed wrongly it would be looking for libgtksourceview-5.so, nevertheless /usr/lib/x86_64-linux-gnu/libgtksourceview-5.so.0 exists in my system.

The above mentioned result.txt file in my machine shows this line. To me this suggests there's something wrong with the way the path is determined.

lamg commented 3 months ago

Problem solved, forgot to call GtkSource.Module.Initialize(), like the example shows here. Thanks!