Best Method To Build Executable(Windows/Linux) From Within An SDL2 App?

Hi,

What is the best method to build an executable from C code for Windows and Linux
from within an SDL2 application?

We are working on a new “Fantasy Computer”.

Jesse

Since Windows do not come with any toolchain(compiler/linker), building new executable on user is really hard.

Alternatively, create a “player” executable and when a user exporting creation, just copy that executable and data files into same directory. For example, game engines such as GameMaker studio or Godot take this way. (Godot refers Player executable and its resources as “export template”)

In case single executable file deployment is your absolute requirement, pack data files into a single file then just concatenate with player executable file. Player executable can fopen() itself through /proc/self or GetModuleFileName etc. Unfortunately, recent Windows doesn’t like this kind of deployment and there’s some chance Windows show some warning on execute.

Well, ok…
Thanks for the info.

This seems impossible…

Jesse

I use that technique and haven’t encountered any problems. The Windows PE format specifically supports ‘Extra Data’ which can be appended onto the end of the executable. I even successfully create signed executables which use the same technique.