You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I am experiencing a serious runtime error when calling function or methods inside side modules implemented inside .cpp files (working when function / method body inside .h)
I am using emscripten to create one main module and two side modules (dynamic libraries).
I use the main module to open and load the two side modules, I can call functions and class inside the side modules across modules HOWEVER if a function body or class method is implemented INSIDE a .cpp, I get this error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'apply')
Did I forgot something or is this a emscripten bug?
I am missing a flag or something? I tried adding EMSCRIPTEN_KEEPALIVE inside the .cpp class method but no luck
classMySuperClass {
public:MySuperClass() {
std::cout << "MySuperClass!" << std::endl;
}
voidcallMeHere() {
std::cout << "callMeHere!" << std::endl;
}
// cannot be called by other module...// TypeError: Cannot read properties of undefined (reading 'apply')voidcallMeThere();
};
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi I am experiencing a serious runtime error when calling function or methods inside side modules implemented inside .cpp files (working when function / method body inside .h)
I am using emscripten to create one main module and two side modules (dynamic libraries).
I use the main module to open and load the two side modules, I can call functions and class inside the side modules across modules HOWEVER if a function body or class method is implemented INSIDE a .cpp, I get this error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'apply')
Did I forgot something or is this a emscripten bug?
I am missing a flag or something? I tried adding
EMSCRIPTEN_KEEPALIVE
inside the .cpp class method but no luck.cpp of side module
Beta Was this translation helpful? Give feedback.
All reactions