Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

WebAssembly build error: undefined symbols



  • Got undefined symbols when building target WebAssembly, native building is ok.

    shared:DEBUG: successfully executed C:/workspace/emsdk/clang/e1.38.30_64bit\llc.exe C:\Users\bugki\AppData\Local\Temp\emscripten_temp\Viewer.bc -march=js -filetype=asm -o C:\Users\bugki\AppData\Local\Temp\emscripten_temp\tmpwhd6jy.4.js -emscripten-stack-size=5242880 -O3 -emscripten-precise-f32 -emscripten-enable-pthreads -emscripten-global-base=1024 -emscripten-wasm -emscripten-only-wasm
    emscripten:DEBUG:   emscript: llvm backend took 21.8819999695 seconds
    emscripten:DEBUG: emscript: js compiler glue
    error: undefined symbol: _ZN14BSplineCurve4ReadER9FStreambi
    warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
    error: undefined symbol: _ZN6BBox3SetERK7PointS2_
    error: undefined symbol: _ZN6BBox4ReadER9FStreambi
    error: undefined symbol: _ZN6BBox5UniteERKS_
    error: undefined symbol: _ZN6BBox5WriteERNSt3__213basic_ostreamIcNS0_11char_traitsIcEEEEbi
    error: undefined symbol: _ZN6BBoxC1Ev
    error: undefined symbol: _ZN6BBoxD1Ev
    error: undefined symbol: _ZN7Frame4ReadER9FStreambi
    error: undefined symbol: _ZN7Frame5WriteERNSt3__213basic_ostreamIcNS0_11char_traitsIcEEEEbi
    error: undefined symbol: _ZN7Frame9TransformERK8Matrix
    error: undefined symbol: _ZN7FrameC1Ev
    error: undefined symbol: _ZN7FrameD1Ev
    error: undefined symbol: _ZN7XForm4ReadER9FStreambi
    error: undefined symbol: _ZN7XFormC1Ev
    error: undefined symbol: _ZN7XFormD1Ev
    error: undefined symbol: _ZN9FStream4ReadEPci
    error: undefined symbol: _ZN9FStream5CloseEv
    error: undefined symbol: _ZN9FStream5TellgEv
    error: undefined symbol: _ZN9FStream6IgnoreEii
    error: undefined symbol: _ZN9FStream6IsOpenEv
    error: undefined symbol: _ZN9FStream7GetLineERNSt3__212basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE
    error: undefined symbol: _ZN9FStreamC1ERKNSt3__212basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEj
    error: undefined symbol: _ZN9FStreamD1Ev
    error: undefined symbol: _ZN9KnotVecC1Ev
    error: undefined symbol: _ZNK7Frame7IsValidEv
    error: undefined symbol: _ZNK8MatrixixEi
    error: undefined symbol: _ZTV14BSplineCurve
    Error: Aborting compilation due to previous errors
    shared:ERROR: 'C:/workspace/emsdk/node/8.9.1_64bit/bin/node.exe C:\workspace\emsdk\emscripten\1.38.30\src\compiler.js C:\Users\bugki\AppData\Local\Temp\emscripten_temp\tmpfnl__e.txt C:\workspace\emsdk\emscripten\1.38.30\src\embind\emval.js C:\workspace\emsdk\emscripten\1.38.30\src\embind\embind.js C:\workspace\emsdk\emscripten\1.38.30\src\library_pthread.js' failed (1)
    cache:DEBUG: PID 344 released multiprocess file lock to Emscripten cache at C:\workspace\emsdk\.emscripten_cache\asmjs
    mingw32-make[1]: *** [Makefile:88: ..\bin\Viewer.js] Error 1
    mingw32-make[1]: Leaving directory 'C:/workspace/SmileCheck/Viewer'
    mingw32-make: *** [Makefile:154: sub-Viewer-make_first] Error 2


  • And where should i put the -s ERROR_ON_UNDEFINED_SYMBOLS=0 var, to bypass these errors.



  • bypass undefined symbol errors, but get error when loading page:

    LinkError: WebAssembly.instantiate(): Import #460 module="env" function="b" error: global import must be a number or WebAssembly.Global object

Log in to reply