O
O
Oleg Komenda2018-02-01 22:00:54
C++ / C#
Oleg Komenda, 2018-02-01 22:00:54

How to embed all files in exe?

Hello, I made a small game
5a73633bb4a79288196395.jpeg
But the problem! Images disappear when I open an exe on another computer:
5a73639b9a307159338975.jpeg
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

6 answer(s)
G
GavriKos, 2018-02-01
@GavriKos

Have you ever seen games that consist of a single exe file?
Put the resources next to the exe and load in relative paths.

D
Dmitry Bashinsky, 2018-02-01
@BashkaMen

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

S
Stanislav Makarov, 2018-02-02
@Nipheris

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 .

R
res2001, 2018-02-02
@res2001

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

A
Alexander Taratin, 2018-02-02
@Taraflex

Lazy version without code rework
Enigma Virtual Box

D
Dmitry Alexandrov, 2018-02-02
@jamakasi666

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 question

Ask a Question

731 491 924 answers to any question