I created a C++ webserver application using Boost.Beast, which is a HTTP/S and WebSockets library relying on Boost.Asio for the networking functionality, and I’ve been trying to compile it to WebAssembly with no success (I can generate .o and .js files, but not .wasm files for it).
I tried using this command to compile my app to WebAssembly:
em++ -std=c++17 -Wall -pedantic -D variant_CONFIG_SELECT_VARIANT=variant_VARIANT_NONSTD -I C:/Jinja2Cpp/install_x64/include -I C:/json/single_include -I C:/boost_1_68_0/ -I C:/Users/Osman/emsdk/emscripten/1.38.18/system/include/ currency_converter.cpp -L C:/Jinja2Cpp/install_x64/lib/static/jinja2cpp.lib -L C:/boost_1_68_0/lib64-msvc-14.1/libboost_system-vc141-mt-x64-1_68.lib -lpthread -o currency_converter.js -o currency_converter.o currency_converter.js -s WASM=1 -s DISABLE_EXCEPTION_CATCHING=0 -s USE_PTHREADS=1
And I also tried to link the .o file to WebAssembly by doing
em++ currency_converter.o -o currency_converter.js -s WASM=1 -s DISABLE_EXCEPTION_CATCHING=0 -s USE_PTHREADS=1
And when that didn’t work I even tried putting the -s flags earlier in the command and providing -I and -L commands, neither of which worked. What am I doing wrong? Please help. Thanks in advance.