SFML/SFML.Net

Library Loading Issues

Opened this issue · 2 comments

Hi, I just started using this library and I already loved it but it has some issues on my end:

  • System.DLLNotFoundException on native libraries because the NuGet package's native libraries start with "lib" and it is trying to load those libraries without the "lib" part (trying to load 'csfml-audio' instead of 'libcsfml-audio'). I worked around it by renaming each library.
  • It is not detecting the system's libFLAC installation (libFLAC.so.12.1.0 in my case) and asks for libFLAC.so.8: instead. Resulting another DLLNotFoundException. I worked around this one as well by just copying my libFLAC to the runtimes/linux-x64/native folder and naming it accordingly. The NuGet package is missing the libFLAC.so.8 file (also on every system). I don't use FLAC audio but it is required by SFML so it creates problems.

NOTE: Installing the SFML and CSFML packages from distribution packages does fix both issues.

More Information:

  • System: Arch Linux
  • FLAC version 1.4.3
  • .NET 8.0 project
  • Using NuGet Package SFML.Audio (I only need audio for now) version 2.6.0

On Linux we usually require users to install their dependencies. It seems that libFLAC.so.8 refers to FLAC 1.3.

Currently, I wouldn't want to change this, but maybe we can further document the requirements.

I can copy the libFLAC.so file to the SFML native binaries folder on end product with no issues but the first "trying to load csfml-audio instead of libcsfml-audio" requires more changes.

My recommendations:

  • Tell the build system that builds those libraries for Linux to not put "lib" in front of them. (CMake ex.: set(CMAKE_STATIC_LIBRARY_PREFIX ""))
  • Check if OS is Linux then put "lib" in front of the library name on the this file.