Jump to page: 1 2
Thread overview
SFML D bindings: libsfml-system.so.2.5: cannot open shared object file:
Feb 03, 2023
thebluepandabear
Feb 03, 2023
bachmeier
Feb 03, 2023
thebluepandabear
Feb 03, 2023
thebluepandabear
Feb 03, 2023
bachmeier
Feb 03, 2023
thebluepandabear
Feb 04, 2023
thebluepandabear
Feb 04, 2023
ryuukk_
Feb 04, 2023
ryuukk_
Feb 04, 2023
thebluepandabear
Feb 04, 2023
bachmeier
Feb 04, 2023
thebluepandabear
Feb 05, 2023
bachmeier
Feb 05, 2023
thebluepandabear
Feb 06, 2023
thebluepandabear
Feb 06, 2023
bachmeier
February 03, 2023

I recently did a fresh install of CSFML and I am getting this errors when running my csfml D bindings 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: https://stackoverflow.com/questions/41516065/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.

Help would be appreciated.

February 03, 2023

On Friday, 3 February 2023 at 10:15:37 UTC, thebluepandabear wrote:

>

I recently did a fresh install of CSFML and I am getting this errors when running my csfml D bindings 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"]

We don't have the full compilation and loading details, but this part of the message seems unusual:

>

"Error: libcsfml-system.so, Message: libsfml-system.so.2.5

One is libcsfml and the other is libsfml.

February 03, 2023

On Friday, 3 February 2023 at 11:37:43 UTC, bachmeier wrote:

>

On Friday, 3 February 2023 at 10:15:37 UTC, thebluepandabear wrote:

>

I recently did a fresh install of CSFML and I am getting this errors when running my csfml D bindings 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"]

We don't have the full compilation and loading details, but this part of the message seems unusual:

>

"Error: libcsfml-system.so, Message: libsfml-system.so.2.5

One is libcsfml and the other is libsfml.

Hi,

It seems like it has changed since then, I am no longer getting those conflicting errors, it's just 'libcsfml' for both instances.

I am thinking of compiling CSFML from scratch to see if it will help, but I'd rather not since it seems complex.

Furthermore, I would like to thank you for bringing up the compilation/loading details up. I'll send a snippet of that if I can figure out how to do so.

February 03, 2023

On Friday, 3 February 2023 at 11:43:46 UTC, thebluepandabear wrote:

>

On Friday, 3 February 2023 at 11:37:43 UTC, bachmeier wrote:

>

On Friday, 3 February 2023 at 10:15:37 UTC, thebluepandabear wrote:

>

I recently did a fresh install of CSFML and I am getting this errors when running my csfml D bindings 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"]

We don't have the full compilation and loading details, but this part of the message seems unusual:

>

"Error: libcsfml-system.so, Message: libsfml-system.so.2.5

One is libcsfml and the other is libsfml.

Hi,

It seems like it has changed since then, I am no longer getting those conflicting errors, it's just 'libcsfml' for both instances.

I am thinking of compiling CSFML from scratch to see if it will help, but I'd rather not since it seems complex.

Furthermore, I would like to thank you for bringing up the compilation/loading details up. I'll send a snippet of that if I can figure out how to do so.

nvm, im getting that error again

February 03, 2023

On Friday, 3 February 2023 at 12:23:40 UTC, thebluepandabear wrote:

>

On Friday, 3 February 2023 at 11:43:46 UTC, thebluepandabear wrote:

>

On Friday, 3 February 2023 at 11:37:43 UTC, bachmeier wrote:

>

On Friday, 3 February 2023 at 10:15:37 UTC, thebluepandabear wrote:

>

I recently did a fresh install of CSFML and I am getting this errors when running my csfml D bindings 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"]

We don't have the full compilation and loading details, but this part of the message seems unusual:

>

"Error: libcsfml-system.so, Message: libsfml-system.so.2.5

One is libcsfml and the other is libsfml.

Hi,

It seems like it has changed since then, I am no longer getting those conflicting errors, it's just 'libcsfml' for both instances.

I am thinking of compiling CSFML from scratch to see if it will help, but I'd rather not since it seems complex.

Furthermore, I would like to thank you for bringing up the compilation/loading details up. I'll send a snippet of that if I can figure out how to do so.

nvm, im getting that error again

It might be a bug in bindbc-sfml. The code is here: https://github.com/BindBC/bindbc-sfml/blob/master/source/bindbc/sfml/system.d#L231 Unbuntu stores the file in /usr/lib/x86_64-linux-gnu/libcsfml-system.so.2.5. Maybe the compiler doesn't know to look in /usr/lib/x86_64-linux-gnu.

February 03, 2023

On Friday, 3 February 2023 at 19:44:07 UTC, bachmeier wrote:

>

On Friday, 3 February 2023 at 12:23:40 UTC, thebluepandabear wrote:

>

On Friday, 3 February 2023 at 11:43:46 UTC, thebluepandabear wrote:

>

On Friday, 3 February 2023 at 11:37:43 UTC, bachmeier wrote:

>

On Friday, 3 February 2023 at 10:15:37 UTC, thebluepandabear wrote:

>

I recently did a fresh install of CSFML and I am getting this errors when running my csfml D bindings 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"]

We don't have the full compilation and loading details, but this part of the message seems unusual:

>

"Error: libcsfml-system.so, Message: libsfml-system.so.2.5

One is libcsfml and the other is libsfml.

Hi,

It seems like it has changed since then, I am no longer getting those conflicting errors, it's just 'libcsfml' for both instances.

I am thinking of compiling CSFML from scratch to see if it will help, but I'd rather not since it seems complex.

Furthermore, I would like to thank you for bringing up the compilation/loading details up. I'll send a snippet of that if I can figure out how to do so.

nvm, im getting that error again

It might be a bug in bindbc-sfml. The code is here: https://github.com/BindBC/bindbc-sfml/blob/master/source/bindbc/sfml/system.d#L231 Unbuntu stores the file in /usr/lib/x86_64-linux-gnu/libcsfml-system.so.2.5. Maybe the compiler doesn't know to look in /usr/lib/x86_64-linux-gnu.

I sent an issue request to bindbc-sfml and they could not reproduce my bug or figure out why it was happening, but I wouldn't be surprised if it is a bug.

February 04, 2023

Could someone (that uses Linux) perhaps try and emulate my bug to see if it's an issue with the bindings or on my system? That would be greatly appreciated!

Steps:

  1. Open up the terminal and type in sudo apt-get install libcsfml-dev

  2. Create a new D project and add the following to dub.json:

"dependencies": {
	"bindbc-sfml": "~>1.0.2",
	"bindbc-loader": "~>1.0.1"
},
"versions": [
	"SFML_Audio",
	"SFML_Graphics",
	"SFML_250"
],
  1. Add the following code to app.d:
import std.stdio;
import bindbc.sfml;
import std.string;
import std.exception;
import bindbc.loader;
import std.conv;

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_display();
	}
}

It should only take around 2-3 minutes.

Regards,
thebluepandabear

February 04, 2023

Are you sure you have installed the version 2.5 in your system?

Can you check in y our library folder if it's there?

February 04, 2023

On Saturday, 4 February 2023 at 04:42:04 UTC, ryuukk_ wrote:

>

Are you sure you have installed the version 2.5 in your system?

Can you check in y our library folder if it's there?

Nvm, i saw your github issue, looks like you have the proper version

I have tested on arch linux and everything works fine, i'll try to setup a linux mint / ubuntu VM tomorrow

February 04, 2023
>

I have tested on arch linux and everything works fine, i'll try to setup a linux mint / ubuntu VM tomorrow

Thanks.

It seems like an issue with my system then. I've been stuck on it for a week or so, but haven't been able to find the root cause of the issue.

« First   ‹ Prev
1 2