0

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.

  • 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 Answers2

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
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.