Skip to content

Dynamic linking emscripten::val(..) fails in SIDE_MODULE #16711

@lpotter

Description

@lpotter

emscripten 3.1.7

Error message: BindingError: emval::as has unknown type N10emscripten3valE

Using emscripten::val("some text") in a SIDE_MODULE fails under some circumstances. Other uses of emscripten::val work, just not the c'tor.

Fails:
emscripten::val rawPlatform = emscripten::val::global("navigator")["platform"];
if (rawPlatform.call("includes", emscripten::val("Mac")))

Succeeds:
emscripten::val rawPlatform = emscripten::val::global("navigator")["platform"];
if (rawPlatform.call("includes", std::string("Mac")))

Both work fine in non dynamic linking build, or if invoked from MAIN_MODULE.

I tried a simple example app, but it was not failing there. But fails in a big project - Qt.

Also, we use MODULARIZE and EXPORT_NAME

Any comments, hints, or suggestions welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions