SFML community forums

Help => General => Topic started by: Moonkis on September 11, 2013, 12:49:11 pm

Title: Running my game in Linux
Post by: Moonkis on September 11, 2013, 12:49:11 pm
I'm currently running Linux ( Ubuntu ) to be specific and I'v managed to build SFML2.1 from the sources. My only problem now is that I'm not sure how to run my binary ( it compiles just fine ).

It complains about missing the specific .so files - I'm guessing the binary dosen't look in the right place. I know this isn't technically speaking an issue of SFML but I figured ( since it's related ) people here would know what to do.

I followed this guide here about compiling and installing sfml om my system:
http://sfmlcoder.wordpress.com/2011/08/16/building-sfml-2-0-with-make-for-gcc/

So, anyone know how to make sure my binary finds my .so files?

( I know I can do LD_LIBRARY_PATH if I run it from the terminal but I want to be able to just "Run" it like normal without the terminal, so there got to be a map )
Title: Re: Running my game in Linux
Post by: Stauricus on September 11, 2013, 01:33:55 pm
which IDE are you using? isn't there an option to build and run?
the .so files are created when you compile SFML. they are in the folder /lib inside your build directory.
try copy/pasting them to your project (or executable) directory
Title: Re: Running my game in Linux
Post by: Moonkis on September 11, 2013, 02:55:12 pm
which IDE are you using? isn't there an option to build and run?
the .so files are created when you compile SFML. they are in the folder /lib inside your build directory.
try copy/pasting them to your project (or executable) directory

I'm using CodeLite, which when I install it is given a locked "root"-access only (  hence I need to start it with sudo command via terminal ). It works super fine, it's just that the .so files aren't located ( I'm linking towards a custom path /home/SFML2.1/lib ). I tried the "make install" but that didn't work either ( though they are installed, but apparently not in the right map ).

I tried adding the binary together with the .dll's in a seperate map, but it didn't work...I feel that I need to add them to some random map in linux, but I don't know which.
Title: Re: Running my game in Linux
Post by: Laurent on September 11, 2013, 03:13:11 pm
The tool which loads (and thus tries to locate) dynamic libraries on Linux is ld, and you can configure it with ldconfig. I let you Google it for more details ;)
Title: Re: Running my game in Linux
Post by: Moonkis on September 11, 2013, 03:35:28 pm
Yeah found it! Thanks!

I have a side question, but when I want to shipp my game for Linux - how does one statically link? Because right of now, I get errors when trying ( even though I have compiled them as static ). ( Undefined references to X ). Or I heard there is a -R command you can send to the linker which forces the binary to look at a specific place. Is that how you do it?
Title: Re: Running my game in Linux
Post by: Laurent on September 11, 2013, 03:44:32 pm
Can you be more precise please? You're trying to link what statically? Undefined references to what? What's the relation with the -R linker option?