Cannot run 3DPrimitivesExample with emscripten on macOS


#1

I ran the following scripts with no errors but the example fails with ‘Error: imported global env:__ZNSt3__14cerrE must be a number’. I have tried running other examples and they have failed with the same errors.

The console shows the following errors:

Executing open -a Safari http://localhost:6931/3DPrimitivesExample.html
Error: imported global env:__ZNSt3__14cerrE must be a number
failed to asynchronously prepare wasm: Error: imported global env:__ZNSt3__14cerrE must be a number
Error: imported global env:__ZNSt3__14cerrE must be a number

Here’s the steps I followed:

curl -LO https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz && tar xvf emsdk-portable.tar.gz
cd emsdk-portable
./emsdk update
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
git clone --depth=1 https://github.com/openFrameworks/openFrameworks.git
cd openFrameworks
scripts/emscripten/./download_libs.sh
cd examples/3d/3DPrimitivesExample
cp ../../../scripts/templates/emscripten/Makefile .
emmake make
emrun bin/3DPrimitivesExample.html

Is anyone able to reproduce this?

I should also mention that I get the following warnings when compiling:

warning: unresolved symbol: _ZN15ofURLFileLoaderC1Ev
warning: unresolved symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcj
warning: unresolved symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEjjPKcj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEjj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEjc
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEjc
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEjjPKcj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEjjjjjj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_jjRKS4_
warning: unresolved symbol: _ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5writeEPKci
warning: unresolved symbol: _Znaj
warning: unresolved symbol: _ZnajRKSt9nothrow_t
warning: unresolved symbol: _Znwj
warning: unresolved symbol: _ZnwjRKSt9nothrow_t
warning: Output contains some very large functions (4442 lines in __ZN6LibRaw15parse_makernoteEii), consider building source files with -Os or -Oz, and/or trying OUTLINING_LIMIT to break them up (see settings.js; note that the parameter there affects AST nodes, while we measure lines here, so the two may not match up)

#2

just tested and this is working for me without problem. The only thing i see is that you are downloading emscripten from a weird server that doesn’t seem to be the official.

Can you try installing emscripten using the official instructions:

https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html


#3

Made the following changes and I’m getting the following warnings again:

I followed the instructions from the site and got the following errors

warning: unresolved symbol: _ZN15ofURLFileLoaderC1Ev
warning: unresolved symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcj
warning: unresolved symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEjjPKcj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEjj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEjc
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEjc
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEjjPKcj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEjjjjjj
warning: unresolved symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_jjRKS4_
warning: unresolved symbol: _ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5writeEPKci
warning: unresolved symbol: _Znaj
warning: unresolved symbol: _ZnajRKSt9nothrow_t
warning: unresolved symbol: _Znwj
warning: unresolved symbol: _ZnwjRKSt9nothrow_t

Here’s a link to the CI build


#4

2 things, you need to also copy config.make to your project folder in order to build a project correctly, the makefile system will try to guess defaults if it’s not there but that hasn’t been maintained in a while so there might be some problems if you don’t copy config.make as well

the github from where you are downloading emscripten is still not the official one, follow the instructions in my previous post to install emscripten correctly


#5


These were the directions i was following. Where are the instructions you were referring to?


#6

oh yeah sorry. they might have changed the repo recently and i wasn’t recognizing the address.

it’s really strange it works for me without problem but some other people have reported that using an older version of emscripten instead of the very latest works fine


#7

I have followed the same exact steps and several iterations and get the exact same results as @amilajack
is there any indication of what we can do
OR
any pointers on which older version of what combined will work!?

all attempts result in this:
missing function: _Znwj


#8

@arturo are you able to compile this inside docker? If so can you please share instructions for doing so. Thanks!


#9

bump!


#10

I have the same issue when compiling 3DPrimitivesExample
Has anyone here been able to resolve the issue?

error: undefined symbol: _ZN15ofURLFileLoaderC1Ev
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
error: undefined symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcj
error: undefined symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEjjPKcj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEjj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEjc
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEjc
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEjjPKcj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEjjjjjj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_jjRKS4_
error: undefined symbol: _ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE5writeEPKci
error: undefined symbol: _Znaj
error: undefined symbol: _ZnajRKSt9nothrow_t
error: undefined symbol: _Znwj
error: undefined symbol: _ZnwjRKSt9nothrow_t
Error: Aborting compilation due to previous errors
shared:ERROR: '/Users/kdkdk/Documents/emsdk/node/8.9.1_64bit/bin/node /Users/kdkdk/Documents/emsdk/emscripten/1.38.21/src/compiler.js /tmp/tmp8NlpIV.txt /Users/kdkdk/Desktop/Supersync/of_v20181222_osx_release/addons/ofxEmscripten/libs/html5video/lib/emscripten/library_html5video.js /Users/kdkdk/Desktop/Supersync/of_v20181222_osx_release/addons/ofxEmscripten/libs/html5audio/lib/emscripten/library_html5audio.js /Users/kdkdk/Documents/emsdk/emscripten/1.38.21/src/library_pthread_stub.js' failed (1)
make[1]: *** [bin/3DPrimitivesExample.html] Error 1
make: *** [Release] Error 2

This is the configuration I have when typing emsdk list

The following precompiled tool packages are available for download:
           clang-e1.30.0-64bit      
           clang-e1.34.1-64bit      
           clang-e1.35.0-64bit      
           clang-e1.37.1-64bit      
           clang-e1.38.20-64bit     
    (*)    clang-e1.38.21-64bit     	INSTALLED
           node-4.1.1-64bit         
    (*)    node-8.9.1-64bit         	INSTALLED
           spidermonkey-37.0.1-64bit
           spidermonkey-nightly-2015-04-12-64bit
           emscripten-1.30.0        
           emscripten-1.34.1        
           emscripten-1.35.0        
           emscripten-1.37.1        
           emscripten-1.38.20       
    (*)    emscripten-1.38.21       	INSTALLED
           crunch-1.04

I’m using the newest nightly build on macOS of_v20181222_osx_release on Mojave 10.14.2


#11

Has anyone solved this problem yet? I have the same issues.
I followed the same instructions on https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html


#12

No, not yet. I’ll look at it in mid february and open a bug report if I can’t resolve it.