Just getting started today with OF but I’m running into this same problem-- I haven’t managed a successful Emscripten build yet. Figured I’d add my attempts in case it helps. In each case, I followed the great instructions from dylanmach.
(Running on OS X 10.13.6 with Xcode 10A255)
(1) embuilder.py build ALL run before emmake make (no change – suggested in an old thread about missing deps)
(2) building with single-threaded make (no change – suggested in a very old Emscripten thread)
(3) also copying the config.make from the template dir (no change)
(4) allowing the undef’d symbols, with adding -s ERROR_ON_UNDEFINED_SYMBOLS=0 to linker flags in config.make (it builds, but then errs out in javascript console “missing function: _ZnwjRKSt9nothrow_t”)
(5) cleared cache in ~/.emscripten_cache to force std libs to rebuild (no change)
I also tried the using a couple older versions of Emscripten sdk (emsdk-1.34.1 and -1.27.0).
Tried latest emsdk with openFrameworks from git (cf08ca38, head of branch patch-release) and of_v0.10.0_osx_release from the download link on the website.
I’m guessing this has something to do with my local configuration-- any ideas or suggestions most welcome!
was getting the same compile errors above
error: undefined symbol: _ZnajRKSt9nothrow_t
on osx 10.13.6 with of_0.10.1.
running emscripten 1.38.10 and then 1.38.20
I ran the emscripten ‘hello world’ test build and that compiles file,
then used @hamoid s advice and script and now the 3DPrimitives example compiles, the errors for _ZnajRKSt9nothrow_t now just being warnings…
but throws error in the browser _
CORS (cross reference api error) missing function: _ZnwjRKSt9nothrow_t
running the files from a webserver gets by the resource CORS error but still gives this as a browser console error…
printErr @ 3DPrimitivesExample.html:166
3DPrimitivesExample.html:166 falling back to ArrayBuffer instantiation
printErr @ 3DPrimitivesExample.html:166
3DPrimitivesExample.js:1 The Web Audio autoplay policy will be re-enabled in Chrome 70 (October 2018). Please check that your website is compatible with it. https://goo.gl/7K7WLu
_html5audio_context_create @ 3DPrimitivesExample.js:1
3DPrimitivesExample.html:166 missing function: _ZnwjRKSt9nothrow_t
printErr @ 3DPrimitivesExample.html:166
3DPrimitivesExample.html:154 -1
3DPrimitivesExample.html:166 -1
printErr @ 3DPrimitivesExample.html:166
3DPrimitivesExample.js:1 Uncaught abort(-1). Build with -s ASSERTIONS=1 for more info.
I also experienced this same problem, using ubuntu 18.10.
This comment by jariseon indicated that a change occurred with emscripten 1.38.10. So the latest version to use that solves this problem is 1.38.9.
The instructions (or script) posted by @hamoid above allow you to change the version of emscripten tool chain being used. Remember to open a new terminal window after changing the tool chain so the new paths are in effect. But the vital step is to remove the old openFrameworks emscripten library object files before attempting to re-compile. If you do not do this step, then you are still using some binaries compiled with your previous version of emscripten.
cd ./libs/openFrameworksCompiled/lib/emscripten
rm -r *
So my working configuration is:
Ubuntu 18.10
openFrameworks (installed from github, on branch patch-release)
Yes, that worked! I had to do a bit of trial and error though and I realized that I already had another installation of emscripten from brew, so I uninstalled it and then followed @hamoid’s example and it worked fine
@theo @stephanschulz, you should also setup a local server on bin folder in order to run the .html file. A basic server is OK. I’m using https://github.com/http-party/http-server
Or you can directly upload the files to your own hosting service…
hey @stephanschulz,
I am having the same problem.
I tried setting the http-server too, but it fails in the same way.
I am in High Sierra and OF GitHub branch.
I didn’t know how to setup this (from OF website):
(Maybe this can be the problem…)So I need to run source ./emsdk_env.sh every time…
type source ./emsdk_env.sh to set the system path to the active version of Emscripten. You can copy the output of this command and add it to your .profile file, in order to save this variables also for the next sessions.
I open a terminal: cd /Users/myUser/Documents/emsdk
then I run: source ./emsdk_env.sh
run: cd /Users/myUser/Documents/openFrameworks/examples/gui
create project with PG with emscripten template.
run: emmake make emrun --browser chrome bin/guiExample.html
so, @stephanschulz, you can try this way.
it’s working here fine. The local http server setup was not required when you run the app with emrun --browser chrome bin/advanced3dExample.html
because it seems ‘it runs his own server’
EDIT:
I noticed that when running the emscripten/download_libs.sh, macOS building stops working, so we can’t share the OF folder to both buildings.
QUESTIONS
how can we add the profile to the system to avoid running source ‘./emsdk_env.sh’ every session?
there’s any way to made it run in Safari? What are the main limitations of Emscripten vs native app?
then cd to:
/Applications/of_v20191201_osx_release/examples/gui/guiExample
then:
emmake make
and get this error:
shared:ERROR: fastcomp is not compatible with wasm object files:obj/emscripten/Release/src/ofApp.o
make[1]: *** [bin/guiExample.html] Error 1
make: *** [Release] Error 2
FYI my nightly build of_v20191201_osx_release does not have download_libs.sh: