Since 1.37.24 lengthBytesUTF8 missing from available exported runtime methods
First of all, thanks for building this great tool! It's been a pleasure to use so far.
Now, since version 1.37.24 a bunch of runtime methods are no longer exported by default. It seems that perhaps lengthBytesUTF8 was forgotten when defining the array of available exported runtime methods.
The resulting behaviour is that Module.lengthBytesUTF8 is undefined, even if specified in the EXTRA_EXPORTED_RUNTIME_METHODS.
I'm not at all experienced with the emscripten source code, but it seems a simple fix would be just to add lengthBytesUTF8 to that array. I can create a pull request if that's the case.
Hello,
Module.lengthBytesUTF8() (as well as Module.stringToUTF8(), Module.Pointer_stringify(), ...) should be now available as global lengthBytesUTF8().
Thanks for the speedy response! I've now exchanged all Module.<function> calls to just <function> and it seems to be working. All good!
I'm having a similar problem when trying to access the code from outside:
cat index.js:
const lib = require('./Module')
lib.lengthBytesUTF8(...)
after
em++ lib.cc ... -o Module.js
@mdobrogostsc you need to export things that you use from the outside, see https://kripken.github.io/emscripten-site/docs/getting_started/FAQ.html#why-do-i-get-typeerror-module-something-is-not-a-function
Thanks @kripken. I get: warning: invalid item (maybe a typo?) in EXPORTED_RUNTIME_METHODS: lengthBytesUTF8.
Thanks @mdobrogostsc , that function was missing from the list of possible exports. Fix in #6159.