I'm working on a game in SFML. It runs correctly on my computer, but if I send it to another computer then when I try to run it I get errors about not being able to find libraries. I did some research and I found that the reason is because I was using dynamic libraries, and to get the program to work on its own I need the static libraries. But how do I get those? They aren't in my sfml
folder. I tried doing more research but I can't find a way to build or download those libraries.
Asked
Active
Viewed 50 times
0

Zach Attack
- 5
- 4
-
Perhaps you could create a distribution package which can be installed elsewhere? Then you could list your dependencies, and the system should install them as part of installing your game. Or in Windows, create an installer which include the DLL's needed. – Some programmer dude Nov 20 '20 at 04:28
-
@Someprogrammerdude I tried including the SFML DLLs, but I still got an error that it couldn't find `libgcc_s_seh-1.dll` and `libstcdc++-6.dll`. – Zach Attack Nov 20 '20 at 04:34
-
Yes, those are needed by the standard library. You can link that [statically](https://stackoverflow.com/questions/44488972/static-libstdc-works-on-g-but-not-on-pure-gcc) if you want. – Botje Nov 20 '20 at 08:36
-
@Botje I added `-static-libstdc++` when compiling but now it says even more files are missing?? – Zach Attack Nov 20 '20 at 23:24
2 Answers
1
Just go to your sfml Src directory and look for the /bin folder. Copy the following DLLs to your game folder where your exe is located:
DLLs
sfml-graphics.dll
sfml-window.dll
sfml-audio.dll
sfml-network.dll
sfml-system.dll
On Linux, install libsfml-dev on target computer.

Adrian Mole
- 49,934
- 160
- 51
- 83

Prabhat Maurya
- 121
- 3
-
should also work if you add the dll location to the PATH env variable, right? – JHBonarius Nov 20 '20 at 11:27
-
Of course yes . But it would become a mess if the person tries to run a software written in different SFML version. – Prabhat Maurya Nov 20 '20 at 12:39
-
I tried that, but I still got an error that it couldn't find `libgcc_s_seh-1.dll` and `libstcdc++-6.dll`. – Zach Attack Nov 20 '20 at 23:16
0
I am sure you are using mingw compiler. You can add static arguments and try.
-static-libgcc -static-libstdc++
If this doesn't work try to search the two DLL files in your standard compiler path /bin folder and place them where your exe is located.

Prabhat Maurya
- 121
- 3
-
Adding static arguments didn't work, but I copied the DLL files and that fixed it. Thank you! – Zach Attack Nov 21 '20 at 00:17