Link error with 1.38.30

46 views
Skip to first unread message

Jérémy Sorant

unread,
Jul 26, 2019, 3:30:21 AM7/26/19
to emscripten-discuss

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.

Jérémy Sorant

unread,
Jul 26, 2019, 8:41:58 AM7/26/19
to emscripten-discuss
Here is a full log with EMCC_DEBUG=2

Gabriel Cuvillier

unread,
Jul 26, 2019, 9:35:31 AM7/26/19
to emscripte...@googlegroups.com

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.

Jérémy Sorant

unread,
Jul 26, 2019, 9:54:07 AM7/26/19
to emscripten-discuss
Hum, you're right, those lib were compiled with emscripten 1.38.6...

I will look at this more closely, thanks a lot.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

Jérémy Sorant

unread,
Jul 29, 2019, 9:42:05 AM7/29/19
to emscripten-discuss
That's it ! 

The other libs where built with emsdk 1.38.6 and I tried to use them in my workspace that uses emsdk 1.38.30.

Thanks a lot !
Reply all
Reply to author
Forward
0 new messages