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

Author Topic: Can SFML run on PCs without having it installed?  (Read 805 times)

0 Members and 1 Guest are viewing this topic.

Niely

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Can SFML run on PCs without having it installed?
« on: April 15, 2015, 08:53:32 pm »
Hello

I tried to run my SFML applications on other Linux distributions, but it didn't worked because SFML wasn't found.
But, it's a compiled program.

Does this mean SFML can only run on computers who have SFML installed?
Or can it run even on computers without having it installed? Because it's compiled?

Thanks for reading,
Niely

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Can SFML run on PCs without having it installed?
« Reply #1 on: April 15, 2015, 10:19:05 pm »
You can run your applications on computers that don't have SFML. But in this case, you need to ship the SFML libraries along with your executable. (I would do this in any case, unless you like users to configure and download libraries before playing the game... Well, on Linux the philosophy may be a bit different in this respect.)

If you download my game Zloxx II for Linux, you'll see how I've done it: the dynamic .so libraries are in a directory relative to the executable. I used the -rpath linker option, some people also write a script that sets the LD_LIBRARY_PATH and calls the executable.

Alternatively, you can try to link SFML statically, but it's generally discouraged on Linux systems.

See also:
http://en.sfml-dev.org/forums/index.php?topic=11092
http://en.sfml-dev.org/forums/index.php?topic=17456
« Last Edit: April 15, 2015, 10:32:00 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything