Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to distribute my game most user-friendly from Linux to Win/Linux?  (Read 2119 times)

0 Members and 1 Guest are viewing this topic.

argoneus

  • Newbie
  • *
  • Posts: 6
    • View Profile
I was wondering about this. I currently have SFML libraries installed in /usr/local on my Linux machine so I can link against those with -lsfml-graphics etc., but how should I distribute the game to a machine both Linux and Windows which doesn't have SFML installed anywhere (and also without the user having to install stuff himself)?

If it helps, I'm using Netbeans C++ for this.

thePyro_13

  • Full Member
  • ***
  • Posts: 156
    • View Profile
For windows, just put the dll's in the same directory as the executable. Or statically link.

By this I mean you should distribute the correct dll's with your game.
« Last Edit: June 09, 2012, 12:41:12 pm by thePyro_13 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
It's common to have seperate packages for each platform.

For a Windows release just put the .exe, .dll and other ressource files into a ZIP or something like that.
For a Linux release you could also just provide the binary and a list for all the dependencies, but I've no idea how it's done best in Linux.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

takoa

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hi, I'm a Linux user, so I will tell you how I expect to find things.
The following are only my opinions, it's not any rule.

The source tarball should only contains sources, no binary.
If you provide binary, the tarball should not contain any sources, but should tell where the sources can be found.

For building the sources don't use an exotic tool. Use something widely known and used.
Your build system should be configurable to find sfml in a non-standard location. Provide at least 2 variables to configure where to find SFML's include and SFML's .so libs. Tell in the README file how to use these 2 variables with an example.

If you provide a binary tarball, you may or may not also provide SFML's .so libs. If you don't tell where to download it. If you do write a "boot .sh" script that first set LD_LIRARY_PATH to the local path where the .so are, and then start your local ./program

LOCDIR=`dirname $0`
SFML_LIBS="${LOCDIR}/sfml_lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SFML_LIBS"
${LOCDIR}/program $*

If you don't provide sfml's .so, you can still provide this script, but tells in the README how to set the variable SFML_LIBS to the location of the sfml's so libs in case it is in a non-standard location.

 

anything