On Sunday, 28 November 2021 at 22:45:29 UTC, Willem wrote:
>// load sdl
string uuid = randomUUID().toString();
string filename = format("SDL2-%s.dll", uuid);
string depacked = buildPath(tempDir(), filename);
std.file.write(depacked, sdlBytes);
DerelictSDL2.load(depacked);
// load curl
string uuid2 = randomUUID().toString();
string filename2 = format("libcurl-%s.dll", uuid2);
string depacked2 = buildPath(tempDir(), filename2);
std.file.write(depacked2, curlBytes);
DerelictSDL2.load(depacked2);
DerelictSDL2.load()
cannot load curl. It is not a generic dll loader. It only loads SDL and doesn't know anything about curl or any other library.
In order to dynamically load curl like this, you need a binding that supports it, i.e., a binding that declares the curl API as function pointers and knows how to load them from the DLL.
Also, DerelictSDL2 is no longer maintained. Please use bindbc-sdl for new projects: