Hello,
I've been testing things with emscripten, especially using Embind to call
C++ code from javascript.
With a test case such as the tutorial, it works ok.
However, I tried with a project where I'm binding 2 base classes (let's say
Toto and Tutu).
I get 2 files, Toto.js and Tutu.js.
If I use either of them separately in a test script, they work.
However, if I try to use both :
<script src="Toto.js"></script>
<script src="Tutu.js"></script>
<script>
... do toto stuff
... do tutu stuff
</script>
Then it doesn't work.
While checking around the 60k+ lines of each files, it seems some functions
called prerun(), run() and postrun() are defined in each file.
And thus it might be that javascript doesn't like redefinition.
Embind should work with multiple files, shouldn't it?
I searched for demos, but only found ones in a single file.
I tried putting a separate binding file :
#include <emscripten/bind.h>
#include "emsLib/Tutu.hpp"
//#include "emsLib/Toto.hpp"
EMSCRIPTEN_BINDINGS(Lib_test)
{
emscripten::class_<Tutu>("Tutu")
.constructor<int>()
.yadayada
;
emscripten::class_<Toto>("Toto")
.constructor<std::string>()
.stuff
;
}
But then I get warning about unresolved symbols, and functions that aren't
exposed.
I can't be the only one to use embind on multiple files in a project, what
do I do wrong?
What am I supposed to do in that case?
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.