0

I recently did a fresh install of CSFML and I am getting this errors when running my program:

object.Exception@source/app.d(38): Fatal error(s) encountered whilst calling `loadSFML()` function:
 ["Error: libcsfml-system.so, Message: libsfml-system.so.2.5: cannot open shared object file: No such file or directory",
 "Error: libcsfml-system.so.2, Message: libcsfml-system.so.2: cannot open shared object file: No such file or directory", 
"Error: libcsfml-system.so.2.0, Message: libcsfml-system.so.2.0: cannot open shared object file: No such file or directory"]

I am using SFML D bindings (https://github.com/BindBC/bindbc-sfml):

void loadDyn() {
    if (!loadSFML()) {
        string[] messages;

        foreach (const(ErrorInfo) err; errors) {
            string errorStr = to!string(err.error);
            string messageStr = to!string(err.message);

            messages ~= format("Error: %s, Message: %s", errorStr, messageStr);
        }

        throw new Exception(format("Fatal error(s) encountered whilst calling `loadSFML()` function: %s", messages));
    }
}

void main() {
    loadDyn();

    sfRenderWindow* renderWindow = sfRenderWindow_create(sfVideoMode(500, 500), "Snake Smooth Dynamics", sfWindowStyle.sfDefaultStyle, null);
    sfEvent event;

    while (renderWindow.sfRenderWindow_isOpen()) {
        while (renderWindow.sfRenderWindow_pollEvent(&event)) {
            if (event.type == sfEventType.sfEvtClosed) {
                renderWindow.sfRenderWindow_close();
            }
        }

        renderWindow.sfRenderWindow_clear(sfYellow);
        renderWindow.sfRenderWindow_drawSprite(snakeHeadSprite, null);
        renderWindow.sfRenderWindow_display();
    }
}

Things I've tried:

  • I found someone with a similar question: Linux SFML - Cannot Open Shared Object File, tried out some answers but to no avail

  • I tried to sudo apt purge every CSFML dependency (graphics, audo, etc) and reinstall each component (csfml-audio, csfml-graphics) manually etc, to no avail.

  • I tried to run sudo ldconfig... didn't work

  • As a last ditch effort I tried to manually move the shared object files to the /usr/local/lib directory (to try and perhaps trick the compiler to run the program?) but to no avail.

  • I tried to run on a new VM and still didn't work

  • I tried to set LD_LIBRARY_PATH environment variable

The amount of layers I depend on make it impossible to find where the bug is from, there are a lot of separate things going on and it's very multilayered, I don't know where the issue is specifically coming from as it used to work just fine I ran the exact same commands to install CSFML previously, now when I do it it just refuses to run. The weird thing is when I ran a brand new virtual machine, installed those packages, still same issue.

I am running Linux Mint 21.1, Ubuntu based. Relatively new PC.

halfer
  • 19,824
  • 17
  • 99
  • 186
thebluepandabear
  • 263
  • 2
  • 7
  • 29
  • Did you actually verify that you have libsfml-system.so.2.5 on your system? – DejanLekic Feb 06 '23 at 12:35
  • @DejanLekic yes, I have it in lib/x86-64-linux-gnu folder or something similar... im desperate for help man .. It only works on Arch linux I'm gonna have to probably wipe out my pc and just use arch if I want to use sfml unless i get help man... thanks – thebluepandabear Feb 06 '23 at 12:46
  • 200 karma, thats a lot of karma.... if you can fix the issue its urs – thebluepandabear Feb 06 '23 at 12:56
  • I would first check the permissions - maybe for whatever reasons, you do not have access to those shared libs... – DejanLekic Feb 06 '23 at 14:17

0 Answers0