C++ dynamic_cast can't build for web

Hi!
try to build https://github.com/SalavatR/def_exprtk_lua project for web, and got errors
use of dynamic_cast requires -frtti

like this

/exprtk_lua/src/exprtk.hpp
Line 9753: In file included from upload/exprtk_lua/src/exprtk_lua.cpp:10:
use of dynamic_cast requires -frtti
9753 | str_base_ptr_ = dynamic_cast<str_base_ptr>(final_node_.first);
| ^

is there any decision?

Did you try in ext.manifest?

name: "ExprtkLua"

platforms:
  web:
    context:
      flags: ["-frtti"]
1 Like

It works, thank you!

1 Like

In Defold code, we don’t use rtti, as we don’t use classes/inheritance, in order to minimize code size.

I mention it as you’re building a html5 game, where you want to be able to minimize size as much as possible.

You can read more on our code style here:

And also, about our best practices for native extensions:

3 Likes