Replies: 2 comments 2 replies
-
I believe you need to just export that symbol it complained about. By exporting from the main module you ensure it is there for the side module when it needs it. (It is a little weird to export a non-function symbol, but it works.)
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I used side module .so file in main module linking stage. Looks like this fixed the issue. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm trying to split my wasm module to several submodules (main + plugin side modules).
Main module is using flag -s MAIN_MODULE=2
Side modules using the same: -s SIDE_MODULE=2.
When i try to open side module using dlopen i get error:
dlopen error: 'Could not load dynamic lib: plugins/importers/gltfImporter.so
Error: bad export type for '_ZNSt3__24cerrE': undefined
It looks like i have to export variable std::cerr from the main module. But i have no idea how to do this.
if i tried to use this declaration:
extern EMSCRIPTEN_KEEPALIVE std::ostream std::cout;
extern EMSCRIPTEN_KEEPALIVE std::ostream std::cerr;
it just doesn't work and compiler outputs warning:
warning: 'used' attribute ignored on a non-definition declaration
Also have no idea how to export this variables from linker command line as it seems like only functions can be exported there, not variables.
Any ideas how to export std::cerr from the main module?
P.S. Using -s MAIN-MODULE=1 is not an option for me as it increases the main module size by 10Mb.
Beta Was this translation helpful? Give feedback.
All reactions