Skip to content

Native library resolution fails on Ubuntu #7

@babelshift

Description

@babelshift

The SDL2-CS library uses PInvoke to load SDL2 libraries. SDL2 is distributed in Windows as SDL2.dll, Mac as libSDL2.dylib, and Linux under varying names such as libSDL2.so or libSDL2-2.0-0.so.

This works properly under the following scenarios:

  • Windows with .NET Framework
  • Mac with Mono
  • Linux with Mono

Mono uses a dllmap algorithm to allow developers to redirect native library resolution in case of libraries not being found with standard names.

.NET Core doesn't have dllmap abilities and instead will only search for the name you provide and slight variations such as appending lib to the front.

While there is a new NativeLibrary class that allows developers to customize the way in which native libraries are resolved, this is only supported in .NET Core 3.0 and above. The library has yet to be added to any version of the .NET Standard, making it challenging to use in a library such as SharpDL that strives to be as broadly accessible as possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions