SFML community forums

Help => General => Topic started by: emmu on July 23, 2013, 11:19:40 pm

Title: Where to deliver shared libaries during installation ?
Post by: emmu on July 23, 2013, 11:19:40 pm
Hello all,

i finished a Plattformer Game  in C++ and SFML. Now i want to share it public for Windows and Linux. Now my Question is, what to do with the SFML libaries who are required for the game. Its easy to link it static but i think its a little bit uncommon on Linux.

Do you have a suggestion how to store the libaries on the enduser system while installation of my game?

I think on Linux i write a little script who check first and if the libaries not exist copy them  in the standardpath /usr/local/lib. But where to make it on Windows Systems ?

How you handle it?

best regards

Emmu
Title: Re: Where to deliver shared libaries during installation ?
Post by: Atani on July 23, 2013, 11:23:46 pm
For windows, you can package the dll files in the same directory as your main program and they will be picked up automatically.

For linux, it would depend on your packaging.  If you are releasing via rpm/deb/etc you can set a dependency on the packages providing the runtime library bits you require.  Another option is to specify LD_LIBRARY_PATH in a sh script to point to your own lib directory, don't overwrite the value but append it as:
LD_LIBRARY_PATH=<my lib dir>:$LD_LIBRARY_PATH

I would not recommend polluting /usr/local/lib with any pre-compiled libraries you deliver unless they are part of your game!
Title: Re: Where to deliver shared libaries during installation ?
Post by: eXpl0it3r on July 23, 2013, 11:24:48 pm
I think on Linux i write a little script who check first and if the libaries not exist copy them  in the standardpath /usr/local/lib.
You probably don't want to do that, since you'll probably need superuser rights and it might override the existing libraries. But I can't say what best practice is on Linux.

But where to make it on Windows Systems ?
You simply put the DLLs next to the exe.
Title: Re: Where to deliver shared libaries during installation ?
Post by: emmu on July 23, 2013, 11:47:11 pm
Oh - thanks you two! That helps me a lot.