Skip to content

libdl.so is not available on many Linux distros, causing crashes on native library load #1492

Closed
@CasualPokePlayer

Description

@CasualPokePlayer

Summary

Many Linux distros do not have libdl.so, rather they only have libdl.so.2. This causes a DllNotFoundException when using its native functions.

This would only occur when using .NET Framework / .NET Standard, as .NET Core / .NET 5+ just use System.Runtime.InteropServices.NativeLibrary instead of P/Invoking libdl directly.

According to the loader readme, the code was taken from NativeLibraryLoader, which seems to have this issue fixed already, so it's probably as simple as porting over that fix.

Steps to reproduce

  • Platform: Linux (Ubuntu 22.04 was used for this case)
  • Framework Version: .NET Framework / .NET Standard (.NET Core / .NET 5+ is not affected)
  1. Do anything which loads in a native library (e.g. Sdl.GetApi).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions