Emsripten aborting with link errors and undefined_symbols [Solved]

HI everybody,
I’m new to the Forum so I’m not sure if this is the right way to do this. And although I’ve been playing around with OF for a while I’m still really a c++ beginner. I’m posting errors messages from an attempt to use Emscripten. I’ve seen similar posts, with similar error messages from various years but I haven’t seen a solution, (at least not one I could really understand). I’m not sure whether I need to re-install, use and older version, or if I’m just doing something wrong.

Any feedback or pointers would be greatly appreciated.
Thanks alot!
error below:

emcc: warning: generating an executable with an object extension (.bc). If you meant to build an object file please use `-c, `-r`, or `-shared` [-Wemcc]
error: undefined symbol: _ZN24ofxEmscriptenSoundStreamC1Ev (referenced by top-level compiled C/C++ code)
warning: Link with `-s LLD_REPORT_UNDEFINED` to get more information on undefined symbols
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
warning: __ZN24ofxEmscriptenSoundStreamC1Ev may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN24ofxEmscriptenSoundStreamD1Ev (referenced by top-level compiled C/C++ code)

warning: __ZN24ofxEmscriptenSoundStreamD1Ev may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN5boost6system15system_categoryEv (referenced by top-level compiled C/C++ code)
warning: __ZN5boost6system15system_categoryEv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN5boost6system16generic_categoryEv (referenced by top-level compiled C/C++ code)
warning: __ZN5boost6system16generic_categoryEv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: tessDeleteTess (referenced by top-level compiled C/C++ code)
warning: _tessDeleteTess may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: tessNewTess (referenced by top-level compiled C/C++ code)
warning: _tessNewTess may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
emcc: error: '/Users/kondek/Applications/emsdk/node/12.18.1_64bit/bin/node /Users/kondek/Applications/emsdk/upstream/emscripten/src/compiler.js /var/folders/gb/4bc2ttjx12q9kdhnw349pqpm0000gn/T/tmp283inf5q.txt' failed (1)
make[2]: *** [/Applications/of_v0.11.0_osx_release2/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.bc] Error 1
make[1]: *** [Release] Error 2
make: *** [Release] Error 2

Hi!

Sorry for the issues!

Can you try the nightly builds at the bottom of the downloads page on the OF site?
Along with the current emscripten setup instructions linked from that page.

I think those builds should all be working.

Theo

HI Theo,
Thanks a lot for the response. But unfortunately no success. I downloaded the nightly build. Also re-installed emscripten. And did what the emscripten docs calls a sanity check. ./emcc --check That showed no errors. When I ran emmake make on the 3D/3Dprimitives Examples. I got the same errors as above. Though oddly it did take a lot longer and seemed to go through many more steps. I’m working on a mac with os 10.15.5.
Is there anything else I might try? Different builds?, different version of emscripten? I just copied my woking code from the older version of OF. I will try now to remake it from scratch in the nightly build.

Once again thanks for all your help and attention.
chris.

Hi,

I just tried on 10.14.6 with the nightly builds and it worked fine for me.
One thing I have found is it is good to completely remove the emsdk/ folder before trying a new setup.

For me I have my emsdk/ folder in my home directory I did the following:

cd ~
rm -rf ~/emsdk
git clone https://github.com/emscripten-core/emsdk
cd emsdk
./emsdk install sdk-1.40.0-64bit
./emsdk activate sdk-1.40.0-64bit
cd ~/Downloads/of_v20210226_osx_release/
cd examples/3d/3DPrimitivesExample/
source ~/emsdk/emsdk_env.sh
emmake make

Maybe delete your emsdk folder from /Users/kondek/Applications/emsdk and try the steps above ( minus the rm -rf ~/emsdk part ).

Hope that helps!
Theo

Hi @kondek,
After you have updated emscripten, try removing the following folders before compiling again:

examples/3d/3DPrimitivesExample/obj/emscripten and 
libs/openFrameworksCompiled/lib/emscripten

Hurray!
Thanks Theo, I removed emsdk. Re-installed it in the home folder as you suggested and it worked. @NickHardeman thanks for the input, for me it worked fine after I re-installed without that step.

thanks again, kondek

Does anyone know if there is any way to get this working with Emscripten 2.x? The 1.x Emscripten is non-functional on ARM Macs and with the 2.x branch I get the same errors that kondek saw.

Hi Folks -
I am running into exactly similar issue here. I am on the new M1 ARM based newer mac.
Tried installing via below command but this complains on missing files:

./emsdk install sdk-1.40.0-64bit

Then tried the below and the installation was successful

./emsdk install latest
./emsdk activate latest

However when I try to compile any example, I see exactly similar error like reported earlier.

error: undefined symbol: _ZN24ofxEmscriptenSoundStreamC1Ev (referenced by top-level compiled C/C++ code)
warning: Link with `-s LLD_REPORT_UNDEFINED` to get more information on undefined symbols
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
warning: __ZN24ofxEmscriptenSoundStreamC1Ev may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: tessDeleteTess (referenced by top-level compiled C/C++ code)
warning: _tessDeleteTess may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: tessNewTess (referenced by top-level compiled C/C++ code)
warning: _tessNewTess may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous error

Any pointers to get this fixed. I am on a M1 mac
Many thanks
Am

I found another post with similar issue discussed but this was specific to Ubuntu/Linux installations but nothing specific to M1. Any suggestions greatly appreciated.

thankyou

@DarkStar 2.0.6 is the newest Emscripten version I can use:

1 Like

Thank you for the suggestion. When I try running

./emsdk install sdk-2.0.6-64bit

I get the following not found error

Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/4ba921c8c8fe2e8cae071ca9889d5c27f5debd87/wasm-binaries-arm64.tbz2': HTTP Error 404: Not Found
error: installation failed!