It seems like the latest Emscripten toolchain has a decision to remove the "--post-js" option, here we can use "-s MODULARIZE" to initialize module as a replacement. FYI:
modularize.cc
#include <emscripten.h>
#include <iostream>
using namespace std;
int main (int argc, char **argv) {
cout << "Hello, Emscripten!" << endl;
return 0;
}
extern "C" int EMSCRIPTEN_KEEPALIVE add (int x, int y) {
return x + y;
}
modularize.html (generated by "emcc", need to revise)
It seems like the latest Emscripten toolchain has a decision to remove the "--post-js" option, here we can use "-s MODULARIZE" to initialize module as a replacement. FYI:
modularize.cc
modularize.html (generated by "emcc", need to revise)
CMD:
*BTW, we can also use
--pre-js
param to append JavaScript code into the resulting script file.