I'm stuck and I hope somebody can help, I am trying to build the h264lib_opencore library to webasm and I successfully built it, I isolated the functions that I need from this massive library and its dependencies that I need and built a .a library from it thru either emmake make, or setting up the toolchain in CLion, it can successfully built static library .a from emscripten toolchain.
However, I don’t think the functions are exported properly so I used the -s EXPORTED_FUNCTIONS command but unfortunately I am getting undefined exported functions even though I already added a EMSCRIPTEN_KEEPALIVE to the function I'm trying to call.
And that function can also be seen in the generated .a file (thru hex editor).
But when I do emcc (or em++) with -s EXPORTED_FUNCTIONS I'm getting an error “undefined exported functions”
What else I am missing here?
the command I used:
em++ libH264lib_opencore.a -o H264lib_opencore.js -s EXPORTED_FUNCTIONS="['_h264_decoder_process_first_frame']"
error
em++: error: undefined exported function: "_h264_decoder_process_first_frame" [-Wundefined] [-Werror]
and if I open hexeditor for the generated .a library, I can see that the function is in there, although named like something like
_ZN16h264lib_opencore32h264_decoder_process_first_frameEPvS0_iS0_iPiS1_i
I also added int EMSCRIPTEN_KEEPALIVE h264_decoder_process_first_frame() in the source before compiling
What am I missing here?