问题
I've been searching a lot for this, but can't seem to find an answer who really does the job. I want to able to play my game, using C++ with SFML, on other computers than my own. I've tried to simply copy the .exe file and the images over, but I just get errors about missing .dll files when I do that. I've seen other people on the SFML forums do this, so it must be possible somehow... I use Microsoft Visual C++ 2010.
回答1:
If you're planning on deploying an SFML application, statically building your project is recommended. This requires also statically building SFML. It takes a little time to setup, but all dependencies will be included in your executable making your application much more reliable and easier to install. This process is not to be confused with statically linking to SFML, which you will still need to do once you've statically build SFML.
You will have to clone the SFML repository and use CMake to generate your visual studio project that will then let you build SFML statically with /MTd for debug and /MT for release. These options can be found in Project Properties > C/C++ > Code Generation > Runtime Library
.
来源:https://stackoverflow.com/questions/8602933/how-to-play-a-sfml-game-on-another-computer