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

Author Topic: How to share SFML games 'correctly' (DLLs issue)?  (Read 11302 times)

0 Members and 1 Guest are viewing this topic.

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
How to share SFML games 'correctly' (DLLs issue)?
« on: November 02, 2010, 08:16:33 pm »
How should I share games using SFML 'correctly" (on windows)? If I would simply share the Executable with resources many people might not be able to run it as DLLs like "sfml-graphics.dll" is not found. Should I include all the necessary DLLs (also of other libs) with my games? I also noticed that a "libgcc" DLL is also needed on others' computers.

How should I do it?
Please note that my previous display name was "Shy Guy".

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
How to share SFML games 'correctly' (DLLs issue)?
« Reply #1 on: November 02, 2010, 08:56:31 pm »
On Windows with mingw, use ldd to check all non-default dlls you link against and provide them with your game.

inlinevoid

  • Newbie
  • *
  • Posts: 49
    • MSN Messenger - inlinevoidmain@gmail.com
    • AOL Instant Messenger - inlinevoid
    • View Profile
    • Email
How to share SFML games 'correctly' (DLLs issue)?
« Reply #2 on: November 03, 2010, 07:14:07 am »
Things you need:

  • The .exe (of course)
  • All of the necessary DLLs.
  • The data (images, sound, etc.)


That's it, no libs required.

Btw, necessary DLLs means libsndfile-1.dll, openal32.dll, and the DLLs associated with the libs you used.  If you used sfml-graphics.lib, then include the sfml-graphics.dll, and so on...

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
How to share SFML games 'correctly' (DLLs issue)?
« Reply #3 on: November 03, 2010, 02:47:17 pm »
Quote from: "Svenstaro"
On Windows with mingw, use ldd to check all non-default dlls you link against and provide them with your game.

I have installed mingw, but I don't find "ldd". Can't find it neither by typing it in the console nor by searching it in mingw's bin folder.

How to I get it for Windows?
And, how should I share applications on Linux?

Quote from: "inlinevoid"
That's it, no libs required.

With "of other libs" I mean DLLs of other libraries.

EDIT:
I can't find 'ldd' via google and I don't know where to get it on the gcc homepage. I have searched and searched, but I only get a lego designer :(

EDIT2:
Btw, when should I provide (or link against) sfml-...-d-Libs, those with the -d?
Please note that my previous display name was "Shy Guy".

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
How to share SFML games 'correctly' (DLLs issue)?
« Reply #4 on: November 03, 2010, 11:40:01 pm »
On Windows, try getting ldd here: http://sourceforge.net/projects/mingwrep/files/altbinutils-pe-bin/1.0/altbinutils-pe-1.0.zip/download

or using Dependency Walker, though I'm not sure if DW is happy with mingw compiled binaries.

On Linux, just tell your users what packages to install and try to provide as few dependencies yourself as possible. If you have to provide custom-compiled dependencies, just provide sfml2-*.so and use
LD_LIBRARY_PATH=path_to_provided-libs ./your_game_binary
if you have to do that.

inlinevoid

  • Newbie
  • *
  • Posts: 49
    • MSN Messenger - inlinevoidmain@gmail.com
    • AOL Instant Messenger - inlinevoid
    • View Profile
    • Email
How to share SFML games 'correctly' (DLLs issue)?
« Reply #5 on: November 04, 2010, 04:52:54 am »
Quote from: "Shy Guy"

Btw, when should I provide (or link against) sfml-...-d-Libs, those with the -d?


When you're running in debug mode you use -d.  When you switch to release you have to link to the normal ones (without any suffix).

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
How to share SFML games 'correctly' (DLLs issue)?
« Reply #6 on: November 04, 2010, 03:04:15 pm »
Quote from: "inlinevoid"
Quote from: "Shy Guy"

Btw, when should I provide (or link against) sfml-...-d-Libs, those with the -d?


When you're running in debug mode you use -d.  When you switch to release you have to link to the normal ones (without any suffix).

Right, I remember, the -d was for debug. I had a though or "dynamic" or something xD ^^


Quote from: "Svenstaro"
On Windows, try getting ldd here: http://sourceforge.net/projects/mingwrep/files/altbinutils-pe-bin/1.0/altbinutils-pe-1.0.zip/download

Okay, it works :)

Quote from: "inlinevoid"
use ldd to check all non-default dlls

Just everything, what is not in "C:\Windows\..." is "non-default"?
Please note that my previous display name was "Shy Guy".

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
How to share SFML games 'correctly' (DLLs issue)?
« Reply #7 on: November 04, 2010, 03:30:01 pm »
Quote from: "Shy Guy"

Right, I remember, the -d was for debug. I had a though or "dynamic" or something xD ^^


That's the normal libraries. -s stands for the static libraries.

And non-default libraries, I think he means any that is not C++ STL.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
How to share SFML games 'correctly' (DLLs issue)?
« Reply #8 on: November 04, 2010, 04:20:57 pm »
Quote from: "Groogy"
-s stands for the static libraries.

Oh, cool, thanks for that little information, too! :) I think I knew it already once, but I forgot xD

Quote from: "Groogy"
And non-default libraries, I think he means any that is not C++ STL.

Is "KERNEL32.dll" non-default? It is not C++ STL, but a default windows dll.

And if for example libraries of GTK+ is needed, isn't it the best way to say GTK+ runtime must be installed (which will copy GTK+ dlls into the system folder) instead of providing the same libraries with every of my applications? I mean, that could also count for other libs than GTK+ ^^
Please note that my previous display name was "Shy Guy".

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
How to share SFML games 'correctly' (DLLs issue)?
« Reply #9 on: November 04, 2010, 04:33:41 pm »
You should provide for a way to install the needed libraries and especially on Windows. For windows, first and most that you will have problem with that the libraries that they might get will be the latest ones and your application might depend on an older version while on Linux this is pretty much fixed for you trough symbolic linking (as long as you link the application directly to the specific version and not the symbolic link when shipping/releasing)

Also it's more convenient if you provide a easy way for the user to install the libraries.

And Kernel32.dll count as default as all applications on Windows link to it.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
How to share SFML games 'correctly' (DLLs issue)?
« Reply #10 on: November 04, 2010, 04:56:56 pm »
Quote from: "Groogy"
Also it's more convenient if you provide a easy way for the user to install the libraries.

As for that, I would like to write an installer that checks for installed libraries and installs missing libs. But I'm not very sure how to check it.

What if I simply put (gtk+) dlls in the system directory with the installer, and the user later installs gtk+ himself, and that installer thinks gtk+ is not installed yet as for example some registry is not set? Is there any convenient way in general how I could provide that kind of installation, or should I always link to (and execute with the installer) the required libs, even if they are already installed?
Please note that my previous display name was "Shy Guy".

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
How to share SFML games 'correctly' (DLLs issue)?
« Reply #11 on: November 04, 2010, 05:11:03 pm »
Easiest thing would to be have the DLL files together with the executable of the application and then your done.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
How to share SFML games 'correctly' (DLLs issue)?
« Reply #12 on: November 04, 2010, 05:47:14 pm »
Quote from: "Groogy"
Easiest thing would to be have the DLL files together with the executable of the application and then your done.

It's the easiest, but at least, when sharing several games and applications, some DLLs will be there more times as needed and it would need quite much memory. In addition, I could think of a small application needing around 5 MB itself, but all "non-default" DLLs (also including GTK+ for example) may bloat it to 10, 20 or even more MBs.
Please note that my previous display name was "Shy Guy".

Spellbreaker

  • Newbie
  • *
  • Posts: 33
    • ICQ Messenger - 287156171
    • MSN Messenger - spellbreaker@live.de
    • Yahoo Instant Messenger - Spellbreaker1979
    • View Profile
    • http://www.apeironstudios.com
How to share SFML games 'correctly' (DLLs issue)?
« Reply #13 on: November 11, 2010, 08:53:59 am »
Why use DLLs anyway? Simply link to the static libraries, and done.

EDIT:

And I don't think you have to care about some 5-10 Megs of DLL Files these days....where people usually have 500000 Megs of Diskspace ;)

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
How to share SFML games 'correctly' (DLLs issue)?
« Reply #14 on: November 11, 2010, 11:10:15 am »
Quote from: "Spellbreaker"
Why use DLLs anyway? Simply link to the static libraries, and done.

I'm not speaking about the SFML libs only. I am thinking of any libraries, for example an alternative for audio playback or something.

Quote from: "Spellbreaker"
And I don't think you have to care about some 5-10 Megs of DLL Files these days....where people usually have 500000 Megs of Diskspace ;)

I'm thinking of several games, mean, if a game would need 5-10 MB of DLLs (which are 'non-default'), it would be a waste of memory if I would have ten or more of those games.
Please note that my previous display name was "Shy Guy".