ASYNCIFY and BigInt Issue

23 views
Skip to first unread message

fidel e.

unread,
Mar 25, 2025, 5:53:33 AMMar 25
to emscripten-discuss
Hello,

I have a C++ class say,

class MediaPacket {
public:
   int64_t timestamp;
}

EMSCRIPTEN_BINDINGS(mp) {
   emscripten::class_<LMediaPacket>("LMediaPacket")
      .constructor<>()
      .property("pts", &LMediaPacket::pts)
}

Then on JS side,

const mpkt = new Module.LMediaPacket();
mpkt.pts;

mpkt.pts shows an error,
Exception: RuntimeError: null function or function signature mismatch

This only happens when I enable the ASYNCIFY flag.
It seems like int64_t is not working when ASYNCIFY is enabled. Have you encountered this issue as well? Would somebody know the fix here?

This is my MAKEFILE,

all:
    emcc -I . -I .. -I ../.. -I ../../../ -I ../../../llib/include -I ../../../llib/include/llib/3rd_party \
    -Wno-inconsistent-missing-override \
    -fno-rtti -fno-exceptions -ffast-math -Wno-unused-value \
    -s WASM=1 \
    -sASYNCIFY=1 \
    -sASYNCIFY_STACK_SIZE=33554432 \
    -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \
    -s ALLOW_MEMORY_GROWTH=1 \
    -s WASM_BIGINT=1 \
    -s EXPORTED_RUNTIME_METHODS=ccall,cwrap,UTF32ToString,UTF16ToString \
    -s EXPORTED_FUNCTIONS=stringToUTF8,lengthBytesUTF8,_malloc,_realloc,_free \
    unifiedwasm.cpp -o ../../lxa/win/lhtml/Web/wasm/unifiedwasm.js \
    --bind
   


Emscripten Version:

 3.1.53

Reply all
Reply to author
Forward
0 new messages