Skip to content

OSX M1, .NET Core 6 - Unable to load shared library 'libHarfBuzzSharp' #1759

@jefim

Description

@jefim

When trying to use any HardBuzzSharp (version 2.6.1.8) I am getting the following at runtime on my MacBook M1:

Unhandled exception. System.DllNotFoundException: Unable to load shared library 'libHarfBuzzSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibHarfBuzzSharp, 1): image not found
   at HarfBuzzSharp.HarfBuzzApi.hb_blob_create(Void* data, UInt32 length, MemoryMode mode, Void* user_data, DestroyProxyDelegate destroy)
   at HarfBuzzSharp.Blob.Create(IntPtr data, Int32 length, MemoryMode mode, ReleaseDelegate releaseProc) in HarfBuzzSharp.dll:token 0x600005f+0x10
   at HarfBuzzSharp.Blob..ctor(IntPtr data, Int32 length, MemoryMode mode, ReleaseDelegate releaseDelegate) in HarfBuzzSharp.dll:token 0x6000054+0x0
   at HarfBuzzSharp.Blob..ctor(IntPtr data, Int32 length, MemoryMode mode) in HarfBuzzSharp.dll:token 0x6000053+0x0
   at ConsoleApp1.Program.Main(String[] args) in /.../ConsoleApp1/ConsoleApp1/Program.cs:line 32

The same problem exists in e.g. SkiaSharp 2.80.3, but all works fine in SkiaSharp 2.88.0-preview61. The dlopen(liblibHarfBuzzSharp, 1) part looks fishy, but I have no idea what it could indicate. The lib itself is in the correct place (runtimes/osx/native/libHarfBuzzSharp.dylib).

My test program really does not do much, this is the code that crashes:

var face = new HarfBuzzSharp.Face(new Blob(IntPtr.Zero, 0, MemoryMode.Duplicate), 0);

Am I doing something wrong or is this a known issue? Any pointers appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions