Status of webassembly output

Hi, It has been some time since I.saw a post here about webassembly output. Since I couldn’t find much information about It I was wondering if there is a sort of guide to start using it.

Currently, I’m working on a html5 project that O build using a simple command line like (on windows)

openfl test html5

Just that. How can I start testing It on webassembly?

The openfl help test command (easy to miss) says that openfl test wasm is the starting point. When I do that out of the box it immediately asks for the Emscripten SDK. Looks like you can find it here: Download and install — Emscripten 3.1.55-git (dev) documentation

I hope that helps!

Thank you a lot. I installed the enevrything and noticed that under Windows I had to set the “EMSCRIPTEN_SDK” variable not to the emsdk folder but to the \upstream\emscripten subfolder instead.

By doing that, the build started working, but I found this problem:

Error: C:/HaxeToolkit/haxe/lib/hxcpp/4,3,2/src/hx/libs/std/Sys.cpp:177:14: error: use of undeclared identifier '_wsetlocale'; did you mean 'setlocale'?
  177 |       return _wsetlocale(LC_TIME,l.wchar_str());
      |              ^~~~~~~~~~~
      |              setlocale
C:\emscripten\emsdk\upstream\emscripten\cache\sysroot/include\locale.h:55:7: note: 'setlocale' declared here
   55 | char *setlocale (int, const char *);
      |       ^
C:/HaxeToolkit/haxe/lib/hxcpp/4,3,2/src/hx/libs/std/Sys.cpp:177:34: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'const wchar_t *'
  177 |       return _wsetlocale(LC_TIME,l.wchar_str());
      |                                  ^~~~~~~~~~~~~
C:\emscripten\emsdk\upstream\emscripten\cache\sysroot/include\locale.h:55:35: note: passing argument to parameter here
   55 | char *setlocale (int, const char *);

Is this a version problem?

I’ve never used Haxe/CPP unfortunately but a quick web search shows this: use of undeclared identifier '_wsetlocale'; with HX_SMART_STRINGS · Issue #867 · HaxeFoundation/hxcpp · GitHub

1 Like

I believe that Joshua Granick fixed some webassembly issues in hxcpp, but they haven’t been released to Haxelib yet. You may need to install hxcpp from the git repo, if you want to use the webassembly target with OpenFL at this time (at least until hxcpp is updated on Haxelib, which does not happen often).

Oh, nice! I’ll wait, then. No need to use it right now.
I thought it would be a lib/version issue since even the DIsplayAsBitmap example doesn’t build correctly.

Thnak you a lot.