SFML community forums
Help => General => Topic started by: MarsCoreTeam on September 25, 2010, 09:30:35 pm
-
Hello there!
I've got pretty much the same question, as mongrol a week ago (http://www.sfml-dev.org/forum/viewtopic.php?t=3175). But now it targets SFML2!
For our project M.A.R.S. (http://www.marsshooter.org) we use SFML2. Distributing executables for Windows is easy and works like a charm.
But since we are mainly developing this game under Linux, we want to provide precompiled versions for Linux as well. So there we go:
Is there any more convenient way to do this than proposed by Svenstaro?
If for whatever reason want to do the work yourself, launch the game in a wrapper script using LD_LIBRARY_PATH=path/to/local/libs and put the shared libraries at that path.
Since SFML2 is in no repository, creating Deb's is no real solution, isn't it?
Greetings,
Simon.
Btw: SFML is awesome!!!
-
You could use cmake to create static libraries and link against those.
-
Using LD_LIBRARY_PATH you get more or less the behavior you see on Windows. I figure this will let you achieve what you are trying to do easily.
You get the same disadvantages you will also get on Windows with this method: It is not nice since it isn't being maintained, tracked and updated by the system package manager and doesn't share memory if you are running multiple SFML applications.
This method is easier than static linking. If you link statically (if you also put libgcc and libstdc++ into it) you will lose exceptions as per gcc manual.
-
Thanks for your advice!
I wrote the following script:
#!/bin/bash
LD_LIBRARY_PATH=${PWD}/lib/:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
exec ${PWD}/main
For me (linux Mint 64 bit) and another PC (ubuntu 64 bit) it worked quite well. In order to test it, you may download from Sourceforge: http://sourceforge.net/projects/mars-game/
Any feedback concerning compatibility is highly appreciated! :wink:
Greetings, Simon.
-
See my launcher script here for one of my games: http://github.com/svenstaro/pseudoform/blob/master/bin/linux/release/portalized_launcher.sh