How to load a model dynamic library? #486
Unanswered
Zachary9079
asked this question in
Q&A
Replies: 1 comment
-
|
(warning: untested code follows) ecs_os_dl_t my_api_dlopen(const char *libname) {
#ifdef _WIN32
return LoadLibraryA(libname);
#elif (defined __linux__)
return dlopen(libname, RTLD_NOW|RTLD_LOCAL);
#else
return NULL;
#endif
}
int main() {
ecs_os_api_t my_api;
/* ... */
my_api.dlopen_ = &my_api_dlopen;
/* ... */
ecs_os_set_api(&my_api);
/* then start using the ECS, for example: */
ecs_world_t *world = ecs_init();
/* ... */However, my code above would override the whole OS API, and I seem to remember that the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Use example_ cpp_ 04_ simple_ Module generates a dynamic library, and then uses the "ecs_import_from_library" interface to import the model dynamic library. The error "library loading not supported, set module_to_dl, dlopen, dlclose and dlproc OS API calls first" will be reported
Beta Was this translation helpful? Give feedback.
All reactions