Hello,
I try to generate a WASM library but the build fails at link step. It seems that we are linking with the wrong standard library as we fail to find "std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char> >::compare(unsigned int, unsigned int, char const*, unsigned int) const".
Do someone know how to fix this ?
Here is the command that fails and the error log:
cmd.exe /C "cd . && C:\dev\emsdk\emscripten\1.38.30\em++.bat -std=c++17 -Oz --llvm-lto 1 -std=c++17 -s DISABLE_EXCEPTION_CATCHING=0 -s MODULARIZE=1 -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s EXPORT_NAME="'WASM_StormshieldData'" -DNDEBUG -O2 --bind -s MODULARIZE=1 -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s EXPORT_NAME="'WASM_StormshieldData'" -O2 JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/binarystream.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/binding.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/aescbc.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/aesctr.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/random.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/hash.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/pbkdf2.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/aeskw.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/rsakeypair.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/rsakeygen.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/x509.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/rsapkcs1-5.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/rs256.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/p12parser.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/smime.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/fileencryptor.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/filedecryptor.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/ioc.cpp.o JsWrapper/CMakeFiles/JSWrapper-wasm.dir/src/exception.cpp.o -o OUTPUT\StormshieldData-wasm.js OUTPUT/libCoreCryptoSDS.a OUTPUT/libCoreCryptoFile.a C:/dev/SDS4C/../EXTERNAL_CACHE/SCM/1.0.2/web/Clang6.0.1/wasm/Release/lib/libSCMStatic.a OUTPUT/libCoreModel.a OUTPUT/libCoreCryptoInterface.a OUTPUT/libUtilities.a C:/dev/SDS4C/../EXTERNAL_CACHE/jsoncpp/1.8.4/web/Clang6.0.1/wasm/Release/lib/libjsoncpp.a C:/dev/SDS4C/../EXTERNAL_CACHE/openssl/1.1.1a/web/Clang6.0.1/wasm/Release/lib/libssl.a C:/dev/SDS4C/../EXTERNAL_CACHE/openssl/1.1.1a/web/Clang6.0.1/wasm/Release/lib/libcrypto.a && cd ."
error: undefined symbol: _ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEjjPKcj
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEjc
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcj
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEjPKc
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEjc
error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEj
error: undefined symbol: _Znaj
error: undefined symbol: _Znwj
Error: Aborting compilation due to previous errors
shared:ERROR: 'C:/dev/emsdk/node/8.9.1_64bit/bin/node.exe C:\dev\emsdk\emscripten\1.38.30\src\compiler.js C:\Users\JEREMY~1.SOR\AppData\Local\Temp\tmpgl7y7z.txt C:\dev\emsdk\emscripten\1.38.30\src\embind\emval.js C:\dev\emsdk\emscripten\1.38.30\src\embind\embind.js C:\dev\emsdk\emscripten\1.38.30\src\library_pthread_stub.js' failed (1)
ninja: build stopped: subcommand failed.
Hello,
How did you compiled the lib*.a files that
are linked with your project (for example: libSCMStatic.a or libcrypto.a)
?
Maybe it is possible they were compiled with a slightly
different version of the standard library (and version of
emscripten). If you can, try to recompile everything from
scratch using the same toolchain version as your JSWrapper
project. Well, that's just a possibility.
Cheers,
Gabriel
--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/bc1c9b6a-5fa5-4d39-9be8-1470fdcaf29d%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.