Emscripten 3.1.19

Here is a branch that works with the current Emscripten version (3.1.19):

The OF libs need to be compiled with the same Emscripten version.
Only problem: The opencv lib does not work (while it was with earlier versions).

Actually opencv works if I comment out line 103 in of_v20220818_linux64gcc6_release/scripts/apothecary/apothecary/build/opencv/3rdparty/protobuf/src/google/protobuf/wire_format_lite.cc

  // static_cast<WireFormatLite::WireType>(-1),  // invalid
  // error: integer value -1 is outside the valid range of values [0, 7] for this enumeration type [-Wenum-constexpr-conversion]

(not sure, if it breaks anything)

And change line 471 in opencv.sh to the absolute path:
source /home/jonathan/emsdk/emsdk_env.sh

The compiled opencv lib needs to be copied into the addon, too: of_v20220818_linux64gcc6_release/addons/ofxOpenCv/libs/opencv/lib/emscripten

I also tried to compile freetype like here: Compile openframeworks in emsdk3.19 environment
But it does not work for me, so I use the included lib with: -s USE_FREETYPE=1

1 Like