SFML community forums

Help => General => Topic started by: firet on July 08, 2021, 06:57:28 pm

Title: If I install via apt-get, I compile my project and distribute it, will it run?
Post by: firet on July 08, 2021, 06:57:28 pm
I have a Chromebook on which I'm running Linux. I installed SFML via apt-get, and no new files appeared (as is normal with apt-get?) I compile my app, and it runs. But if I distribute the executable, will it run on other devices without having to install SFML on that device?
I'm using GCC to compile.
Title: Re: If I install via apt-get, I compile my project and distribute it, will it run?
Post by: Stauricus on July 08, 2021, 11:00:52 pm
i'm not the best person to explain this, but it depends.
if you set static libraries, everything will be compiled in your executable.
if you set dynamic libraries, its a bit more complex to set it (the users will have to download their own SFML; usually in managers like apt-get, this is done automatically).

but yes, you can install SFML through apt-get and distribute your executable.
Title: Re: If I install via apt-get, I compile my project and distribute it, will it run?
Post by: firet on July 08, 2021, 11:47:07 pm
Thanks!  :) Just one more question:
How do I statically link SFML libraries? I Googled it, but nothing was very useful. Also, does "usually in managers like apt-get, this is done automatically" mean I don't need to statically link them?
I'm considering having an installer shell script that will just install SFML on to the user device and set up the executable, so that's a fine backup plan :)
Title: Re: If I install via apt-get, I compile my project and distribute it, will it run?
Post by: eXpl0it3r on July 09, 2021, 08:59:28 am
apt-get will give you dynamic SFML libraries, you'd need to build SFML yourself as static library (check the CMake tutorial), but on Linux that's usually not recommended
Title: Re: If I install via apt-get, I compile my project and distribute it, will it run?
Post by: firet on July 09, 2021, 03:51:20 pm
Thanks! These forums are very helpful :). I think I may just go with the installer idea, because that way thhe app will be set up with the version of SFML that is suitable for that system.