www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Derelict3: can't load a shared library

reply "Andrey" <andr-sar yandex.ru> writes:
I know this isn't quite a right place for my problem, but you 
need to wait uncertain amount of time for registration on the 
official derelict forum, so I decided to start here.

import derelict.sfml2.window;
import derelict.sfml2.system;

import std.file;

void main() {

     version(Posix) {
         string SFML2_window = "lib/libcsfml-window.so";
     }

     assert(SFML2_window.isFile);

     DerelictSFML2Window.load(SFML2_window);

}

After running this program I surprisingly get:

--Failed to load one or more shared libraries:
	lib/libcsfml-window.so - libsfml-window.so.2: cannot open shared 
object file: No such file or directory

Needless to say, I DO have this directory and file in proper 
place with other .so files from SFML library. But I'm new to deal 
with dynamic shared libs, so maybe I miss something.
Nov 02 2012
next sibling parent "Mike Parker" <aldacron gmail.com> writes:
On Friday, 2 November 2012 at 18:33:39 UTC, Andrey wrote:
 I know this isn't quite a right place for my problem, but you 
 need to wait uncertain amount of time for registration on the 
 official derelict forum, so I decided to start here.

Sorry. That's a problem with DSource. The maintainer hasn't been around in a long while. I'll have to look into moving the Derelict forums somewhere else, probably to my own server, when I have a chance.
 import derelict.sfml2.window;
 import derelict.sfml2.system;

 import std.file;

 void main() {

     version(Posix) {
         string SFML2_window = "lib/libcsfml-window.so";
     }

     assert(SFML2_window.isFile);

     DerelictSFML2Window.load(SFML2_window);

 }

 After running this program I surprisingly get:

 --Failed to load one or more shared libraries:
 	lib/libcsfml-window.so - libsfml-window.so.2: cannot open 
 shared object file: No such file or directory

 Needless to say, I DO have this directory and file in proper 
 place with other .so files from SFML library. But I'm new to 
 deal with dynamic shared libs, so maybe I miss something.

Not sure what's going on here. In the error message, the part before the '-' indicates that Derelict is attempting to load the library name you told it to. But the part after the '-' is the message reported by the system, and that indicates the system is looking for a different file name (and, oddly, an SFML file rather than CSFML). Is lib/libcsfml-window.so by chance a symlink? My Linux box is not immediately available and I am swamped with my new business, so I'm afraid I'll be rather useless in helping you figure this out.
Nov 02 2012
prev sibling next sibling parent "Andrey" <andr-sar yandex.ru> writes:
I don't really understand where does that "libsfml-window.so.2" 
string come from. The file is 100% fully fledget .so shared 
library, not a symlink.

Maybe it tries to follow default system (env) path instead of 
checking local lib dir.

:-(
Nov 03 2012
prev sibling parent bioinfornatics <bioinfornatics fedoraproject.org> writes:
Le vendredi 02 novembre 2012 =C3=A0 19:33 +0100, Andrey a =C3=A9crit :
 I know this isn't quite a right place for my problem, but you=20
 need to wait uncertain amount of time for registration on the=20
 official derelict forum, so I decided to start here.

you can open an issuer from github to discuss about your problem -> https://github.com/aldacron/Derelict3/issues
Nov 04 2012