简体   繁体   中英

how to make my executable not rely on sfml dll files [c++] [minGW] [g++]

Perhaps I can "create" these necessary files by having them linked to the exe, and store them in a temp folder when the program launches, and if that's possible how please? I've tried messing around with compiler options but nothing seems to work.

In order your executable to not rely on DLL files, you should link them statically. SFML gives you that option by using their "sfml-xxx-sd.lib" (for Debug) and "sfml-xxx-s.lib" (for Release) libraries, as stated in the documentation.

If you want to get rid of these DLLs and have SFML directly integrated into your executable, you must link to the static version. Static SFML libraries have the "-s" suffix: "sfml-xxx-sd.lib" for Debug, and "sfml-xxx-s.lib" for Release. In this case, you'll also need to define the SFML_STATIC macro in the preprocessor options of your project.

NOTE: "xxx" stands for the name of the file you are trying to include into your project

Full documentation on how to set up SFML in VisualStudio: https://www.sfml-dev.org/tutorials/2.5/start-vc.php

Hope this answered your question! :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM