Hi there!

When using the sample c++ code from
https://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_and_javascript/embind.html#classes
it just works as long as I do not use the optimization -O2.

When I compile with that option, my browser always tells me "TypeError: 
Module.MyClass is not a constructor". In 
https://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html#calling-compiled-c-functions-from-javascript-using-ccall-cwrap
 
it sais "At higher optimisation levels (-O2 and above), the *closure 
compiler* 
<https://kripken.github.io/emscripten-site/docs/site/glossary.html#term-closure-compiler>
 
runs and minifies (changes) function names. Exporting functions allows you 
to continue to access them using the original name through the global Module 
object.", so I tried using the option -s EXPORTED_FUNCTIONS, but it seems 
to work only for functions, not classes.

What am I doing wrong? Would it work to export global functions which serve 
as constructors for my classes? Sounds like a hack to me...

Best regards,
Björn

-- 
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.

Reply via email to