Answer the question
In order to leave comments, you need to log in
How to embed all files in exe?
Hello, I made a small game
But the problem! Images disappear when I open an exe on another computer:
What should I do? How to download all the pictures and libraries inside the exe (the weight of the program does not matter)
I work in Visual Studio 2017, the language is c ++ and the sfml library
Answer the question
In order to leave comments, you need to log in
Have you ever seen games that consist of a single exe file?
Put the resources next to the exe and load in relative paths.
Open the properties of the project, throw it all files into resources.
Then you can use them, but I don't remember the code, then googled Winforms resources
P.s. I'm calling from phone
Resource Files (Visual Studio) ( in Russian ).
A convenient utility for viewing (checking what happened after compilation and what actually went where in the resources): Resource Hacker .
As mentioned above, design all files as resources in the project. Further in the code, you need to load them using the WinAPI functions: FindResource() and LoadResource(), get the size of the resource - SizeofResource().
Another option is to drive the necessary resources into base64 and store the resulting string directly in the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question