charto / nbind

:sparkles: Magical headers that make your C++ library accessible from JavaScript :rocket:
MIT License
1.98k stars 119 forks source link

std::string support is broken #144

Open mmarczell-graphisoft opened 2 years ago

mmarczell-graphisoft commented 2 years ago

This code

class SomeClass {
    public:
    std::string SomeString () {
        return "Hello";
    }
};

#include "nbind/nbind.h"

NBIND_CLASS(SomeClass) {
    method(SomeString);
}

and then invoking the method from JS fails at runtime with

Uncaught TypeError: Module.Pointer_stringify is not a function

Pointer_stringify was removed from the emscripten SDK and replaced with UTF8ToString.