10#include "../../stdafx.h"
14#include "../../library_loader.h"
16#include "../../safeguards.h"
19#if defined(__EMSCRIPTEN__)
23 this->
error =
"Dynamic loading is not supported on this platform.";
33 this->
error =
"Dynamic loading is not supported on this platform.";
41 void *h = dlopen(filename.c_str(), RTLD_NOW | RTLD_LOCAL);
43 this->
error = dlerror();
56 void *p = dlsym(this->
handle, symbol_name.c_str());
58 this->
error = dlerror();
std::optional< std::string > error
The last error that occurred, if set.
void * OpenLibrary(const std::string &filename)
Open the library with the given filename.
void * handle
Handle to the library.
void * GetSymbol(const std::string &symbol_name)
Get a symbol from the library.
void CloseLibrary()
Close the library.